[irstlm] 63/78: bug fixed

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


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

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

commit b66de355aeab97de1a8ac5c9ff2474c31c66bdbd
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Sun Dec 6 10:21:50 2015 +0100

    bug fixed
---
 src/lmtable.cpp | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/lmtable.cpp b/src/lmtable.cpp
index 3efaa0c..8902d12 100644
--- a/src/lmtable.cpp
+++ b/src/lmtable.cpp
@@ -2265,7 +2265,7 @@ namespace irstlm {
 	//non recursive version
 	const char *lmtable::maxsuffptr(ngram ong, unsigned int* size)
 	{
-		VERBOSE(3,"const char *lmtable::maxsuffptr(ngram ong, unsigned int* size)\n");
+		VERBOSE(3,"const char *lmtable::maxsuffptr(ngram ong, unsigned int* size) ong:|" << ong <<"|\n");
 		
 		if (ong.size==0) {
 			if (size!=NULL) *size=0;
@@ -2313,7 +2313,7 @@ namespace irstlm {
 	
 	const char *lmtable::cmaxsuffptr(ngram ong, unsigned int* size)
 	{
-		VERBOSE(3,"const char *lmtable::maxsuffptr(ngram ong, unsigned int* size) ong:|" << ong  << "|\n");
+		VERBOSE(3,"const char *lmtable::cmaxsuffptr(ngram ong, unsigned int* size) ong:|" << ong  << "|\n");
 		
 		if (ong.size==0) {
 			if (size!=NULL) *size=0;
@@ -2369,16 +2369,17 @@ namespace irstlm {
 	//It relies on the computation of maxsuffptr
 	ngram_state_t lmtable::maxsuffidx(ngram ong, unsigned int* size)
 	{
-		VERBOSE(3,"ngram_state_t lmtable::maxsuffidx(ngram ong, unsigned int* size)\n");
-		
-		const char* suffptr = cmaxsuffptr(ong,size);
-		return convert(suffptr,*size);
+		VERBOSE(3,"ngram_state_t lmtable::maxsuffidx(ngram ong, unsigned int* size) ong:|" << ong  << "|\n");
+		unsigned int isize;
+		const char* suffptr = cmaxsuffptr(ong,&isize);
+		if (size) *size=isize;
+		return convert(suffptr,isize);
 	}
 	
 	ngram_state_t lmtable::cmaxsuffidx(ngram ong, unsigned int* size)
 	{
 		VERBOSE(3,"ngram_state_t lmtable::cmaxsuffidx(ngram ong, unsigned int* size) ong:|" << ong  << "|\n");
-		
+
 		if (ong.size==0) {
 			if (size!=NULL) *size=0;
 			return 0;
@@ -2511,7 +2512,7 @@ namespace irstlm {
 					iprob=ng.prob;
 					lpr = (double)(isQtable?Pcenters[ng.size][(qfloat_t)iprob]:iprob);
 					if (*ng.wordp(1)==dict->oovcode()) lpr-=logOOVpenalty; //add OOV penalty
-					if (maxsuffptr || statesize) { //one extra step is needed if ng.size=ong.size
+					if (maxsuffptr || maxsuffidx || statesize) { //one extra step is needed if ng.size=ong.size
 						if (ong.size==ng.size) {
 							ng.size--;
 							get(ng,ng.size,ng.size);

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