[irstlm] 35/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 600001cc206e514b491617ed5fa01c821932d338
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Fri Jul 31 19:48:34 2015 +0200

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

diff --git a/src/mdiadapt.cpp b/src/mdiadapt.cpp
index ba60da1..f81e520 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]++;
 		}
@@ -1596,7 +1597,7 @@ namespace irstlm {
 					}
 					VERBOSE(3,"mdiadaptlm::saveARPA_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