[irstlm] 36/126: fixed a bug

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:42 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 c79c8f4e659e2d0dd94317601c059f644c63f0e4
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Fri Jul 31 19:52:21 2015 +0200

    fixed a bug
---
 src/mdiadapt.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mdiadapt.cpp b/src/mdiadapt.cpp
index ba60da1..83a6edf 100644
--- a/src/mdiadapt.cpp
+++ b/src/mdiadapt.cpp
@@ -1430,8 +1430,9 @@ namespace irstlm {
 		if (_OOV_unigram){
 			ngram ung(dict,1);
 			*ung.wordp(1)=dict->oovcode();
-			pr=oovprob;
 			ibow=0.0;
+			pr=oovprob;
+			pr=(pr?log10(pr):-99);
 			lmt->addwithoffset(ung,(float)pr,(float)ibow);
 			num[1]++;
 		}
@@ -1594,9 +1595,9 @@ namespace irstlm {
 					}else { //i==maxlev
 						ibow=0.0; //default value for backoff weight at the highest level
 					}
-					VERBOSE(3,"mdiadaptlm::saveARPA_per_level(char *filename,int backoff,char* subdictfile ) writing w:|" << (char *)dict->decode(w) << "| pr:" << pr << " ibow:" << ibow << std::endl);
+					VERBOSE(3,"mdiadaptlm::saveBIN_per_level(char *filename,int backoff,char* subdictfile ) writing w:|" << (char *)dict->decode(w) << "| pr:" << pr << " ibow:" << ibow << std::endl);
 					if (ibow != DONT_PRINT ) {
-						lmt->add(ng,(float)log10(pr),(float)ibow);
+						lmt->add(ng,(float)pr,(float)ibow);
 					}
 				}
 				//add unigram with OOV and its accumulate oov probability

-- 
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