summaryrefslogtreecommitdiff
path: root/decoder/ff_fsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/ff_fsa.h')
-rwxr-xr-xdecoder/ff_fsa.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/decoder/ff_fsa.h b/decoder/ff_fsa.h
index 0b60ff81..ed159853 100755
--- a/decoder/ff_fsa.h
+++ b/decoder/ff_fsa.h
@@ -6,6 +6,7 @@
#include "ff.h"
#include "sparse_vector.h"
#include "value_array.h"
+#include "tdict.h"
typedef ValueArray<uint8_t> Bytes;
@@ -32,8 +33,18 @@ struct FsaFeatureFunction {
// regular bottom up scorer from Fsa feature
template <class Impl>
-struct FeatureFunctionFromFsa : public FeatureFunction,Impl {
- FeatureFunctionFromFsa(
+struct FeatureFunctionFromFsa : public FeatureFunction {
+ Impl& d() { return static_cast<Impl&>(*this); }
+ Impl const& d() { return static_cast<Impl const&>(*this); }
+
+ FeatureFunctionFromFsa() { }
+ Init() {
+ name=d().name;
+ SetStateSize(sizeof(WordID)*2*MarkovOrder
+ } // can't do this in constructor because we come before d() in order
+
+ virtual Features Features() const { return d().Features(); }
+
};