[irstlm] 17/78: minor changes

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:47:01 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 b878acab7ec27f61357386111ea0ef92583dc09c
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Sun Nov 8 22:32:16 2015 +0100

    minor changes
---
 src/lmInterpolation.cpp | 19 ++++++-------------
 src/lmInterpolation.h   |  2 +-
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/lmInterpolation.cpp b/src/lmInterpolation.cpp
index a8badab..24e5c1f 100644
--- a/src/lmInterpolation.cpp
+++ b/src/lmInterpolation.cpp
@@ -73,7 +73,7 @@ namespace irstlm {
 		m_isinverted.resize(m_number_lm);
 		m_lm.resize(m_number_lm);
 		
-		VERBOSE(2,"lmInterpolation::load(const std::string &filename,int mmap) m_number_lm:"<< m_number_lm << std::endl;);
+		VERBOSE(2,"lmInterpolation::load(const std::string &filename,int mmap) m_number_lm:"<< m_number_lm << std::endl);
 		
 		dict->incflag(1);
 		for (int i=0; i<m_number_lm; i++) {
@@ -94,7 +94,7 @@ namespace irstlm {
 			
 			m_weight[i] = (float) atof(words[0]);
 			m_file[i] = words[1];
-			VERBOSE(2,"lmInterpolation::load(const std::string &filename,int mmap) m_file:"<< words[1] << std::endl;);
+			VERBOSE(2,"lmInterpolation::load(const std::string &filename,int mmap) m_file:"<< words[1] << std::endl);
 			
 			m_lm[i] = load_lm(i,memmap,ngramcache_load_factor,dictionary_load_factor);
 			//set the actual value for inverted flag, which is known only after loading the lM
@@ -152,12 +152,9 @@ namespace irstlm {
 		int _bol=0,actualbol=MAX_NGRAM;
 		double _bow=0.0,actualbow=0.0; 
 		double _lastbow=0.0,actuallastbow=0.0; 
-		bool _extendible=false;
-		bool actualextendible=false;
+		bool _extendible=false,actualextendible=false;
 		
-		//		ngram_state_t* maxsuffidx = new ngram_state_t;
-		
-		for (size_t i=0; i<m_lm.size(); i++) {
+		for (size_t i=0; i<m_number_lm; i++) {
 			
 			if (m_weight[i]>0.0){
 				ngram _ng(m_lm[i]->getDict());
@@ -228,9 +225,7 @@ namespace irstlm {
 		char *maxsuffptr=NULL;
 		unsigned int _statesize=0,actualstatesize=0;
 		
-		//		ngram_state_t* maxsuffidx = new ngram_state_t;
-		
-		for (size_t i=0; i<m_lm.size(); i++) {
+		for (size_t i=0; i<m_number_lm; i++) {
 			
 			if (m_weight[i]>0.0){
 				ngram _ng(m_lm[i]->getDict());
@@ -268,9 +263,7 @@ namespace irstlm {
 		ngram_state_t maxsuffidx=0;
 		unsigned int _statesize=0,actualstatesize=0;
 		
-		//		ngram_state_t* maxsuffidx = new ngram_state_t;
-		
-		for (size_t i=0; i<m_lm.size(); i++) {
+		for (size_t i=0; i<m_number_lm; i++) {
 			
 			if (m_weight[i]>0.0){
 				ngram _ng(m_lm[i]->getDict());
diff --git a/src/lmInterpolation.h b/src/lmInterpolation.h
index 2f12265..1ecf570 100644
--- a/src/lmInterpolation.h
+++ b/src/lmInterpolation.h
@@ -45,7 +45,7 @@ namespace irstlm {
 	class lmInterpolation: public lmContainer
 	{
 		static const bool debug=true;
-		int m_number_lm;
+		size_t m_number_lm;
 		int order;
 		int dictionary_upperbound; //set by user
 		double  logOOVpenalty; //penalty for OOV words (default 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