diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-26 04:53:15 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-26 04:53:15 +0000 |
commit | f4b4aade473f9463dda6fac4baf9c0502d004deb (patch) | |
tree | 7b6641f2733b4d64a9f1e273c0f6f2b8fd757d5f /decoder/ff_lm_fsa.h | |
parent | b2ad842245f1645e4e9f3c60a80a07e13151a560 (diff) |
LanguageModelFsa works. TODO: sri context shortening?
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@414 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_lm_fsa.h')
-rwxr-xr-x | decoder/ff_lm_fsa.h | 15 |
1 files changed, 13 insertions, 2 deletions
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<LanguageModelFsa> { + // 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<LanguageModelFsa> LanguageModelFromFsa; |