[irstlm] 54/78: Merge branch 'master' into cd-correction-model

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:47:06 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 3602a157f79a950f9429d4c67ab2babd1f759ae4
Merge: 4d3c155 4b9ac23
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Sat Nov 28 16:59:34 2015 +0100

    Merge branch 'master' into cd-correction-model

 src/lmContainer.h |  2 +-
 src/lmtable.cpp   | 98 +++++++++++++++----------------------------------------
 src/lmtable.h     |  2 ++
 3 files changed, 30 insertions(+), 72 deletions(-)

diff --cc src/lmtable.cpp
index 5f250a1,e6bdfee..a35986d
--- a/src/lmtable.cpp
+++ b/src/lmtable.cpp
@@@ -2246,20 -2246,17 +2246,30 @@@ namespace irstlm 
  		}
  		return 0;
  	}
 +
 +	/* returns into the dictionary the successors of the given ngram */
 +	void lmtable::getSuccDict(ngram& ng,dictionary* d){
 +		ngram hg=ng;	
 +		hg.pushc(0);
 +		if (get(hg,hg.size,hg.size-1)){
 +			ngram _ng=hg;
 +			succscan(hg,_ng,LMT_INIT,_ng.size);
 +			while(succscan(hg,_ng,LMT_CONT,_ng.size)) {
 +				d->encode(_ng.dict->decode(*_ng.wordp(1)));
 +			}   
 +		}
 +	}
  	
+ 	ngram_state_t lmtable::convert(const char* suffptr, size_t lev){
+ 		int ndsz=nodesize(tbltype[lev]);
+ 		ngram_state_t suffidx=0;
+ 		if (suffptr){
+ 			suffidx = (ngram_state_t) ( ((table_pos_t) suffptr - (table_pos_t) table[lev]) / ndsz ) + tb_offset[lev] + 1; //added 1 to distinguish from zero-ngram
+ 		}
+ 		return suffidx;
+ 	}
+ 	
+ 	
  	//maxsuffptr returns the largest suffix of an n-gram that is contained
  	//in the LM table. This can be used as a compact representation of the
  	//(n-1)-gram state of a n-gram LM. If the input k-gram has k>=n then it

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