diff options
author | redpony <redpony@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-20 18:36:34 +0400 |
---|---|---|
committer | redpony <redpony@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-20 18:36:34 +0400 |
commit | 9943b40d4c9ee9cf3115a1da64916521d3ead11c (patch) | |
tree | 7d0b74c6a89a246e878c88c9a7749e2dbdcc4566 /moses | |
parent | 6020abb071efe4410f5c0be553f9be2500193b19 (diff) |
use InputFileStream to read IRST lm files (enables them to be gzipped)
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@214 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rwxr-xr-x | moses/src/LanguageModel_IRST.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/moses/src/LanguageModel_IRST.cpp b/moses/src/LanguageModel_IRST.cpp index 0729791dc..8d60d2bbb 100755 --- a/moses/src/LanguageModel_IRST.cpp +++ b/moses/src/LanguageModel_IRST.cpp @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "Util.h" #include "FactorCollection.h" #include "Phrase.h" +#include "InputFileStream.h" using namespace std; @@ -64,8 +65,10 @@ void LanguageModel_IRST::Load(size_t id double decay = 0.95; // + InputFileStream inp(fileName); + m_lmtb = new lmtable( - fileName.c_str(), + inp, nGramOrder, resolution, decay @@ -110,8 +113,14 @@ float LanguageModel_IRST::GetValue(const vector<const Factor*> &contextFactor) c ngram ng(m_lmtb->dict); for (size_t i = 0 ; i < count ; i++) { +#ifdef CDYER_DEBUG_LMSCORE + std::cout << i <<"="<<contextFactor[i]->GetLmId().irst <<"," << contextFactor[i]->GetString()<<" "; +#endif ng.pushc(contextFactor[i]->GetLmId().irst); } +#ifdef CDYER_DEBUG_LMSCORE + std::cout <<" (ng='" << ng << "')\n"; +#endif return TransformScore(m_lmtb->prob(ng)); } |