[irstlm] 47/78: fixings

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:47:05 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 71c5db0f05116e3fa7edf842b3fdfbcf1b7f9c27
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Fri Nov 20 12:16:02 2015 +0100

    fixings
---
 src/context-similarity.h   |  1 +
 src/lmContextDependent.cpp | 15 ++++++++-------
 src/lmInterpolation.cpp    |  4 ++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/context-similarity.h b/src/context-similarity.h
index 5a67f53..5079dbf 100644
--- a/src/context-similarity.h
+++ b/src/context-similarity.h
@@ -141,6 +141,7 @@ namespace irstlm {
 				case TOPIC_SCORE_TYPE_2:
 				case TOPIC_SCORE_TYPE_3:
 					m_score_type = t;
+					break;
 				default:
 					std::stringstream ss_msg;
 					ss_msg << "Topic score type " << m_score_type << " is unknown.";
diff --git a/src/lmContextDependent.cpp b/src/lmContextDependent.cpp
index d4a18d4..c0029c6 100644
--- a/src/lmContextDependent.cpp
+++ b/src/lmContextDependent.cpp
@@ -80,7 +80,7 @@ namespace irstlm {
 		tokenN = parseWords(line,words,LMCONTEXTDEPENDENT_CONFIGURE_MAX_TOKEN);
 		
 		bool error=false;
-		if ((tokenN!=1) || (tokenN!=3)){
+		if (! (tokenN==1 || tokenN==3) ){
 			error=true;     
 		}else if ((strcmp(words[0],"LMCONTEXTDEPENDENT") != 0) && (strcmp(words[0],"lmcontextdependent")!=0)) {
 			error=true;
@@ -89,7 +89,7 @@ namespace irstlm {
 		}
 		if (error){
 			std::stringstream ss_msg;
-			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format;
+			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format.str();
 			exit_error(IRSTLM_ERROR_DATA,ss_msg.str());
 		}
 		
@@ -98,17 +98,18 @@ namespace irstlm {
 			_score_type = TOPIC_SCORE_TYPE_2;
 		}else{
 			_score_type = atoi(words[2]);
-		}	
+		}
 		
 		//reading ngram-based LM
 		inp.getline(line,BUFSIZ,'\n');
 		tokenN = parseWords(line,words,1);
-		if(tokenN < 1 || tokenN > 1) {
+		
+		if(tokenN != 1) {
 			error=true;
 		}
 		if (error){
 			std::stringstream ss_msg;
-			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format;
+			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format.str();
 			exit_error(IRSTLM_ERROR_DATA,ss_msg.str());
 		}
 		
@@ -129,13 +130,13 @@ namespace irstlm {
 		//reading topic model
 		inp.getline(line,BUFSIZ,'\n');
 		tokenN = parseWords(line,words,LMCONTEXTDEPENDENT_CONFIGURE_MAX_TOKEN);
-		
+	
 		if(tokenN < 5 || tokenN > LMCONTEXTDEPENDENT_CONFIGURE_MAX_TOKEN) {
 			error= true;
 		}
 		if (error){
 			std::stringstream ss_msg;
-			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format;
+			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format.str();
 			exit_error(IRSTLM_ERROR_DATA,ss_msg.str());
 		}
 		
diff --git a/src/lmInterpolation.cpp b/src/lmInterpolation.cpp
index 99fb403..53c019b 100644
--- a/src/lmInterpolation.cpp
+++ b/src/lmInterpolation.cpp
@@ -80,7 +80,7 @@ namespace irstlm {
 		
 		if (error){
 			std::stringstream ss_msg;
-			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format;
+			ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format.str();
 			exit_error(IRSTLM_ERROR_DATA,ss_msg.str());
 		}
 		
@@ -121,7 +121,7 @@ namespace irstlm {
 			}
 			if (error){
 				std::stringstream ss_msg;
-				ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format;
+				ss_msg << "ERROR: wrong header format of configuration file\ncorrect format:" << ss_format.str();
 				exit_error(IRSTLM_ERROR_DATA,ss_msg.str());
 			}
 			

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