[irstlm] 77/78: bug fixed

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:47:08 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 473863b051e5be7337f8fc524b890d9ad855e1fc
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Mon Dec 28 23:01:06 2015 +0100

    bug fixed
---
 src/lmContainer.h     | 52 +++++++++++++++++----------------------------------
 src/lmInterpolation.h | 30 +----------------------------
 src/lmtable.h         | 27 --------------------------
 3 files changed, 18 insertions(+), 91 deletions(-)

diff --git a/src/lmContainer.h b/src/lmContainer.h
index f4d79c2..d20be0f 100644
--- a/src/lmContainer.h
+++ b/src/lmContainer.h
@@ -155,14 +155,16 @@ namespace irstlm {
 		virtual double clprob(int* ng, int ngsize, topic_map_t& topic_weights, double* bow=NULL, int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL,bool* extendible=NULL, double* lastbow=NULL)
 		{
                         //create the actual ngram
-                        ngram ong(getDict());
-                        ong.pushc(ng,ngsize);
-                        MY_ASSERT (ong.size == ngsize);
+//                        ngram ong(getDict());
+//                        ong.pushc(ng,ngsize);
+//                        MY_ASSERT (ong.size == ngsize);
 
-			return clprob(ong, topic_weights, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
+                        UNUSED(topic_weights);
+			return clprob(ng, ngsize, topic_weights, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
+			//return clprob(ong, topic_weights, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
 		}
 
-	//this is a function which could be overwritten	
+	//this is a function which should be overwritten	
 		virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
                 {
                         UNUSED(ng);
@@ -181,45 +183,25 @@ namespace irstlm {
                 virtual double clprob(ngram ng, topic_map_t& topic_weights, double* bow=NULL, int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL,bool* extendible=NULL, double* lastbow=NULL)
                 {
                         UNUSED(topic_weights);
-                        UNUSED(ng);
-                        UNUSED(bow);
-                        UNUSED(bol);
-                        UNUSED(maxsuffidx);
-                        UNUSED(maxsuffptr);
-                        UNUSED(statesize);
-                        UNUSED(extendible);
-                        UNUSED(lastbow);
-                        
-                        return 0.0;
+			return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
 		}                
 
+	//this is a function which could be overwritten	
 		virtual double clprob(string_vec_t& text, double* bow=NULL,int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL,bool* extendible=NULL, double* lastbow=NULL)
 		{
-			UNUSED(text);
-			UNUSED(bow);
-			UNUSED(bol);
-			UNUSED(maxsuffidx);
-			UNUSED(maxsuffptr);
-			UNUSED(statesize);
-			UNUSED(extendible);
-			UNUSED(lastbow);
-
-                        return 0.0;
+                        //create the actual ngram
+                        ngram ng(getDict());
+                        ng.pushw(text);
+                        VERBOSE(3,"ng:|" << ng << "|" << std::endl);
+                        MY_ASSERT (ng.size == (int) text.size());
+                        return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
 		} 
 
+	//this is a function which could be overwritten	
 		virtual double clprob(string_vec_t& text, topic_map_t& topic_weights, double* bow=NULL,int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL,bool* extendible=NULL, double* lastbow=NULL)
 		{ 
 			UNUSED(topic_weights);
-                        UNUSED(text);
-			UNUSED(bow);
-			UNUSED(bol);
-			UNUSED(maxsuffidx);
-			UNUSED(maxsuffptr);
-			UNUSED(statesize);
-                        UNUSED(extendible);
-                        UNUSED(lastbow);
-
-                        return 0.0;
+			return clprob(text, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
 		}
 
 		virtual const char *cmaxsuffptr(ngram ng, unsigned int* statesize=NULL)
diff --git a/src/lmInterpolation.h b/src/lmInterpolation.h
index e4b132b..8f0f0fe 100644
--- a/src/lmInterpolation.h
+++ b/src/lmInterpolation.h
@@ -80,35 +80,7 @@ namespace irstlm {
 		
 		virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow);
 		virtual double clprob(ngram ng, topic_map_t& lm_weights, double* bow=NULL, int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL,bool* extendible=NULL, double* lastbow=NULL);
-		
-		virtual double clprob(string_vec_t& text, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
-		{
-			VERBOSE(2,"lmInterpolation::clprob(string_vec_t& text, ...)" << std::endl);
-			
-			//create the actual ngram
-			ngram ng(dict);
-			ng.pushw(text);
-			VERBOSE(3,"ng:|" << ng << "|" << std::endl);		
-			for (size_t i=0; i<m_number_lm; i++) {
-				VERBOSE(2,"this:|" << (void*) this << "| i:" << i << " m_weight[i]:" << m_weight[i] << endl);
-			}
-			MY_ASSERT (ng.size == (int) text.size());
-			return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
-		}
-		
-		virtual double clprob(string_vec_t& text, topic_map_t& lm_weights, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
-		{
-			VERBOSE(2,"lmInterpolation::clprob(string_vec_t& text, topic_map_t& lm_weights, ...)" << std::endl);
-			
-			//create the actual ngram
-			ngram ng(dict);
-			ng.pushw(text);
-			VERBOSE(3,"ng:|" << ng << "|" << std::endl);		
-			
-			MY_ASSERT (ng.size == (int) text.size());
-			return clprob(ng, lm_weights, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
-		}
-		
+
 		virtual const char *cmaxsuffptr(ngram ong, unsigned int* size=NULL);
 		virtual ngram_state_t cmaxsuffidx(ngram ong, unsigned int* size=NULL);
 		
diff --git a/src/lmtable.h b/src/lmtable.h
index e1d09f1..f9b18e8 100644
--- a/src/lmtable.h
+++ b/src/lmtable.h
@@ -318,33 +318,6 @@ namespace irstlm {
 		void filter(const char* /* unused parameter: lmfile */) {};
 		virtual double lprob(ngram ng, double* bow=NULL, int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL, bool* extendible=NULL, double* lastbow=NULL);
 		virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow);
-
-		virtual double clprob(string_vec_t& text, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
-		{
-			VERBOSE(2,"lmtable::clprob(string_vec_t& text, ...)" << std::endl);
-			
-			//create the actual ngram
-			ngram ng(dict);
-			ng.pushw(text);
-			VERBOSE(3,"ng:|" << ng << "|" << std::endl);
-			MY_ASSERT (ng.size == (int) text.size());
-			return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
-		}
-		
-		virtual double clprob(string_vec_t& text, topic_map_t& lm_weights, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
-		{
-			UNUSED(lm_weights);
-			VERBOSE(2,"lmtable::clprob(string_vec_t& text, topic_map_t& lm_weights, ...)" << std::endl);
-			
-			//create the actual ngram
-			ngram ng(dict);
-			ng.pushw(text);
-			VERBOSE(3,"ng:|" << ng << "|" << std::endl);		
-			
-			MY_ASSERT (ng.size == (int) text.size());
-			return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
-		}
-		
 		virtual const char *maxsuffptr(ngram ong, unsigned int* size=NULL);
 		virtual const char *cmaxsuffptr(ngram ong, unsigned int* size=NULL);
 		virtual ngram_state_t maxsuffidx(ngram ong, unsigned int* size=NULL);

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