From f4b4aade473f9463dda6fac4baf9c0502d004deb Mon Sep 17 00:00:00 2001 From: graehl Date: Mon, 26 Jul 2010 04:53:15 +0000 Subject: LanguageModelFsa works. TODO: sri context shortening? git-svn-id: https://ws10smt.googlecode.com/svn/trunk@414 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff_lm_fsa.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'decoder/ff_lm_fsa.h') diff --git a/decoder/ff_lm_fsa.h b/decoder/ff_lm_fsa.h index 01b3764e..6a4e8201 100755 --- a/decoder/ff_lm_fsa.h +++ b/decoder/ff_lm_fsa.h @@ -6,10 +6,21 @@ #include "ff_lm.h" #include "ff_from_fsa.h" -class LanguageModelFsa : public FsaFeatureFunctionBase { +struct LanguageModelFsa : public FsaFeatureFunctionBase { + // overrides; implementations in ff_lm.cc static std::string usage(bool,bool); LanguageModelFsa(std::string const& param); - // implementations in ff_lm.cc + int markov_order() const { return ctxlen_; } + void Scan(SentenceMetadata const& /* smeta */,const Hypergraph::Edge& /* edge */,WordID w,void const* old_st,void *new_st,FeatureVector *features) const; + void print_state(std::ostream &,void *) const; + + // impl details: + void set_ngram_order(int i); // if you build ff_from_fsa first, then increase this, you will get memory overflows. otherwise, it's the same as a "-o i" argument to constructor + double floor_; // log10prob minimum used (e.g. unk words) +private: + int ngram_order_; + int ctxlen_; // 1 less than above + LanguageModelImpl *pimpl_; }; typedef FeatureFunctionFromFsa LanguageModelFromFsa; -- cgit v1.2.3