[irstlm] 104/126: minor bug fixed

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

giuliopaci-guest pushed a commit to annotated tag adaptiveLM.v0.1
in repository irstlm.

commit 0889bc9878f2ff7d548d9b11513317dd60b92416
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Tue Sep 22 12:32:46 2015 +0200

    minor bug fixed
---
 src/context-similarity.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/context-similarity.cpp b/src/context-similarity.cpp
index e0b0ea1..31dd4db 100644
--- a/src/context-similarity.cpp
+++ b/src/context-similarity.cpp
@@ -274,9 +274,8 @@ namespace irstlm {
 		// ng2[1]=ng[1];
 		ngram ng2(ngt2.getDict());
 		ng2.trans(ng);
-		int topic=*ng.wordp(1);
 		ng2.shift();
-		*ng2.wordp(2)=topic;
+		*ng2.wordp(1)=ng2.dict->encode(ng.dict->decode(*ng.wordp(1)));
 		
 		//ngt2 provides counts c(hk) and c(h) (or c(k) and c())
 		double c_xk2, c_x2;
@@ -324,9 +323,8 @@ namespace irstlm {
 		// ng2[1]=ng[1];
 		ngram ng2(ngt2.getDict());
 		ng2.trans(ng);
-		int topic=*ng.wordp(1);
 		ng2.shift();
-		*ng2.wordp(2)=topic;
+		*ng2.wordp(1)=ng2.dict->encode(ng.dict->decode(*ng.wordp(1)));
 		
 		//ngt2 provides counts c(hk) and c(h) (or c(k) and c())
 		double c_xk2, c_x2;
@@ -459,7 +457,7 @@ namespace irstlm {
 			//return an uninforming score (log(1.0) = 0.0)
 			ret_log10_pr = 0.0;
 		}
-		else if (m_topic_size == 0){
+		else if (topic_weights.size() == 0){
 			//a-priori topic distribution is "empty", i.e. there is no score for any topic
 			//return an uninforming score (log(1.0) = 0.0)
 			ret_log10_pr = 0.0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/irstlm.git



More information about the debian-science-commits mailing list