[irstlm] 71/78: merge mmt-dev into cd-correction-model ; solved conflicts
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 6315f22632b08f87bcbc754f91c242e68262a67b
Merge: 6eb4ede 05e0d48
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date: Thu Dec 10 00:26:30 2015 +0100
merge mmt-dev into cd-correction-model ; solved conflicts
src/lmContainer.h | 109 +++++++++++++++++++++-----------------------------
src/lmInterpolation.h | 2 +-
src/lmclass.h | 10 +----
src/lmmacro.h | 4 +-
src/lmtable.h | 20 ++-------
5 files changed, 54 insertions(+), 91 deletions(-)
diff --cc src/lmContainer.h
index 17ab9df,7d52273..67ec5db
--- a/src/lmContainer.h
+++ b/src/lmContainer.h
@@@ -119,44 -110,24 +119,23 @@@ namespace irstlm
virtual bool is_inverted(const bool flag) {
UNUSED(flag);
return false;
- };
+ }
virtual bool is_inverted() {
return false;
- };
+ }
- virtual double clprob(ngram ng) {
-
- VERBOSE(3,"double lmContainer::clprob(ngram ng) ng:|" << ng << "|\n");
- return clprob(ng, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- }
+ virtual double clprob(ngram ng) { return clprob(ng, NULL, NULL, NULL, NULL, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow) { return clprob(ng, bow, NULL, NULL, NULL, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow, int* bol) { return clprob(ng, bow, bol, NULL, NULL, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr) { return clprob(ng, bow, bol, NULL, maxsuffptr, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize) { return clprob(ng, bow, bol, NULL, maxsuffptr, statesize, NULL, NULL); }
- virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize, bool* extendible) { return clprob(ng, bow, bol, NULL, maxsuffptr, statesize, extendible, NULL); };
+ virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize, bool* extendible) { return clprob(ng, bow, bol, NULL, maxsuffptr, statesize, extendible, NULL); }
- virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow) {
- VERBOSE(3,"double lmContainer::clprob(ngram ng,double* bow, int* bol, ngram_state_t* ngramstate, char** state, unsigned int* statesize, bool* extendible, double* lastbow) ng:|" << ng << "|\n");
- return clprob(ng, bow, bol, NULL, maxsuffptr, statesize, extendible, lastbow);
- }
+ virtual double clprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow) { return clprob(ng, bow, bol, NULL, maxsuffptr, statesize, extendible, lastbow); }
virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx) { return clprob(ng, bow, bol, maxsuffidx, NULL, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr) { return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, NULL, NULL, NULL); }
virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize) { return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, NULL, NULL); }
- virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible) { return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, NULL); }
-
- virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible, double* lastbow)
- {
- UNUSED(ng);
- UNUSED(bow);
- UNUSED(bol);
- UNUSED(maxsuffidx);
- UNUSED(maxsuffptr);
- UNUSED(statesize);
- UNUSED(extendible);
- UNUSED(lastbow);
-
- return 0.0;
- }
+ virtual double clprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible) { return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, NULL); };
-
virtual double clprob(int* ng, int ngsize){ return clprob(ng, ngsize, NULL, NULL, NULL, NULL, NULL, NULL, NULL); }
virtual double clprob(int* ng, int ngsize, double* bow){ return clprob(ng, ngsize, bow, NULL, NULL, NULL, NULL, NULL, NULL); }
@@@ -165,51 -136,54 +144,55 @@@
virtual double clprob(int* ng, int ngsize, double* bow, int* bol, ngram_state_t* maxsuffidx){ return clprob(ng, ngsize, bow, bol, maxsuffidx, NULL, NULL, NULL, NULL); }
virtual double clprob(int* ng, int ngsize, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, 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);
-
+ //create the actual ngram
+ ngram ong(getDict());
+ ong.pushc(ng,ngsize);
+ MY_ASSERT (ong.size == ngsize);
+
- return clprob(ng, ngsize, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
+ return clprob(ong, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
- }
- 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);
- return clprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
}
+
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)
{
- UNUSED(topic_weights);
- return clprob(ng, ngsize, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
- }
+ //create the actual ngram
+ ngram ong(getDict());
+ ong.pushc(ng,ngsize);
+ MY_ASSERT (ong.size == ngsize);
- 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;
- }
-
- 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(text);
- UNUSED(topic_weights);
- UNUSED(bow);
- UNUSED(bol);
- UNUSED(maxsuffidx);
- UNUSED(maxsuffptr);
- UNUSED(statesize);
- UNUSED(extendible);
- UNUSED(lastbow);
- return 0.0;
+ return clprob(ng, ngsize, topic_weights, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, lastbow);
}
-
+
++ //this is a function which could 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);
+ UNUSED(bow);
+ UNUSED(bol);
+ UNUSED(maxsuffidx);
+ UNUSED(maxsuffptr);
+ UNUSED(statesize);
+ UNUSED(extendible);
+ UNUSED(lastbow);
+
+ return 0.0;
+ }
+
+ //this is a function which could be overwritten
+ 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;
+ }
+
virtual const char *cmaxsuffptr(ngram ng, unsigned int* statesize=NULL)
{
UNUSED(ng);
diff --cc src/lmInterpolation.h
index d592a2b,6869d4e..e4b132b
--- a/src/lmInterpolation.h
+++ b/src/lmInterpolation.h
@@@ -78,36 -72,7 +78,36 @@@ namespace irstlm
virtual void load(const std::string &filename,int mmap=0);
lmContainer* load_lm(int i, int memmap, float nlf, float dlf);
- virtual double clprob(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(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 --cc src/lmtable.h
index b4c1703,c6f301d..e1d09f1
--- a/src/lmtable.h
+++ b/src/lmtable.h
@@@ -315,50 -315,10 +315,36 @@@ namespace irstlm
int reload(std::set<string> words);
- void filter(const char* /* unused parameter: lmfile */) {}
- /*
- virtual double lprob(ngram ng){ return lprob(ng, NULL, NULL, NULL, NULL, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow){ return lprob(ng, bow, NULL, NULL, NULL, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol){ return lprob(ng, bow, bol, NULL, NULL, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, char** maxsuffptr){ return lprob(ng, bow, bol, NULL, maxsuffptr, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize){ return lprob(ng, bow, bol, NULL, maxsuffptr, statesize, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, char** maxsuffptr, unsigned int* statesize, bool* extendible){ return lprob(ng, bow, bol, NULL, maxsuffptr, statesize, extendible, NULL); }
-
- virtual double lprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx){ return lprob(ng, bow, bol, maxsuffidx, NULL, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr){ return lprob(ng, bow, bol, maxsuffidx, maxsuffptr, NULL, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize){ return lprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, NULL, NULL); }
- virtual double lprob(ngram ng, double* bow, int* bol, ngram_state_t* maxsuffidx, char** maxsuffptr, unsigned int* statesize, bool* extendible){ return lprob(ng, bow, bol, maxsuffidx, maxsuffptr, statesize, extendible, NULL); }
- */
-
- 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=NULL, int* bol=NULL, ngram_state_t* maxsuffidx=NULL, char** maxsuffptr=NULL, unsigned int* statesize=NULL, bool* extendible=NULL, double* lastbow=NULL);
+ 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