[irstlm] 07/78: made functions virtual

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:47:00 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 b3ed3d164074399463c13560c67b85126c4225b0
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Fri Nov 6 17:01:53 2015 +0100

    made functions virtual
---
 src/lmtable.cpp | 8 ++++----
 src/lmtable.h   | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lmtable.cpp b/src/lmtable.cpp
index 5f9a3dc..cb96bb1 100644
--- a/src/lmtable.cpp
+++ b/src/lmtable.cpp
@@ -2707,17 +2707,17 @@ namespace irstlm {
 						if (statesize)	*statesize=ng.size;
 						if (maxsuffptr)	*maxsuffptr=ng.link; //we should check ng.link != NULL
 						
-						size_t _level=ng.size;
-						VERBOSE(3,"lmtable::lprob(ngram) ng:|" << ng << "| _level:|" << _level << "|" << std::endl);
+						size_t isize=ng.size;
+						VERBOSE(3,"lmtable::lprob(ngram) ng:|" << ng << "| isize:|" << isize << "|" << std::endl);
 //						VERBOSE(3,"lmtable::lprob(ngram) ng:|" << ng << "| (void*) table:|" << (void*) table << "|" << std::endl);
 //						VERBOSE(3,"lmtable::lprob(ngram) ng:|" << ng << "| (void*) ng.link:|" << (void*) ng.link << "|" << std::endl);
 						
 						
 						if (maxsuffidx){
-							int ndsz=nodesize(tbltype[_level]);
+							int ndsz=nodesize(tbltype[isize]);
 							*maxsuffidx=0;
 							if (ng.link){
-								*maxsuffidx = (ngram_state_t) ( ((table_pos_t) (ng.link) - (table_pos_t) table[_level]) / ndsz ) + tb_offset[_level] + 1; //added 1 to distinguish from zero-ngram
+								*maxsuffidx = (ngram_state_t) ( ((table_pos_t) (ng.link) - (table_pos_t) table[isize]) / ndsz ) + tb_offset[isize] + 1; //added 1 to distinguish from zero-ngram
 							}
 							
 							VERBOSE(3,"lmtable::lprob(ngram) ng:|" << ng << "| *maxsuffidx:|" << *maxsuffidx << "|" << std::endl);
diff --git a/src/lmtable.h b/src/lmtable.h
index b27495f..340eebd 100644
--- a/src/lmtable.h
+++ b/src/lmtable.h
@@ -350,9 +350,9 @@ public:
 	virtual const char *maxsuffptr(ngram ong, unsigned int* size=NULL);
 	virtual const char *cmaxsuffptr(ngram ong, unsigned int* size=NULL);
   virtual const char *cmaxsuffptr(int* codes, int sz, unsigned int* size=NULL);
-	ngram_state_t maxsuffidx(ngram ong, unsigned int* size=NULL);
-  ngram_state_t cmaxsuffidx(ngram ong, unsigned int* size=NULL);
-  ngram_state_t cmaxsuffidx(int* codes, int sz, unsigned int* size=NULL);
+	virtual ngram_state_t maxsuffidx(ngram ong, unsigned int* size=NULL);
+  virtual ngram_state_t cmaxsuffidx(ngram ong, unsigned int* size=NULL);
+  virtual ngram_state_t cmaxsuffidx(int* codes, int sz, unsigned int* size=NULL);
 	
 	inline void putmem(char* ptr,int value,int offs,int size) {
 		MY_ASSERT(ptr!=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