diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-23 02:27:28 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-23 02:27:28 +0000 |
commit | 8c6536c56c728213b9e1190f0c9f76f7b4948140 (patch) | |
tree | ab192e932935ea25f77924836e40e9adf0034caa /decoder/ff_fsa_dynamic.h | |
parent | 9ac87abac855aaaa6c1dcf686b38443092a10ce6 (diff) |
bottom-up FF from fsa FF - WordPenaltyFsa - needs debugging
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@373 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_fsa_dynamic.h')
-rwxr-xr-x | decoder/ff_fsa_dynamic.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/decoder/ff_fsa_dynamic.h b/decoder/ff_fsa_dynamic.h new file mode 100755 index 00000000..79672bdc --- /dev/null +++ b/decoder/ff_fsa_dynamic.h @@ -0,0 +1,29 @@ +#ifndef FF_FSA_DYNAMIC_H +#define FF_FSA_DYNAMIC_H + +#include "ff_fsa.h" + +// the type-erased interface +/* +struct FsaFeatureFunction { + virtual int markov_order() const = 0; + virtual ~FsaFeatureFunction(); + +}; + +// conforming to above interface, type erases FsaImpl +// you might be wondering: why do this? answer: it's cool, and it means that the bottom-up ff over ff_fsa wrapper doesn't go through multiple layers of dynamic dispatch +template <class Impl> +struct FsaFeatureFunctionDynamic : public FsaFeatureFunction { + Impl& d() { return static_cast<Impl&>(*this); } + Impl const& d() { return static_cast<Impl const&>(*this); } + int markov_order() const { return d().markov_order(); } +}; + +//TODO: wrap every method in concrete fsaff and declare in interface above. +//TODO: combine 2 (or N) FsaFeatureFunction (type erased) + +*/ + + +#endif |