summaryrefslogtreecommitdiff
path: root/decoder/ff_fsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/ff_fsa.h')
-rwxr-xr-xdecoder/ff_fsa.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/decoder/ff_fsa.h b/decoder/ff_fsa.h
index 45837f2c..a5563511 100755
--- a/decoder/ff_fsa.h
+++ b/decoder/ff_fsa.h
@@ -66,6 +66,16 @@ usage: see ff_sample_fsa.h or ff_lm_fsa.h
template <class Impl>
struct FsaFeatureFunctionBase {
+ // CALL 1 of these MANUALLY (because feature name(s) may depend on param, it's not done in ctor)
+ void Init(std::string const& fname="") {
+ fid_=FD::Convert(fname.empty()?name():fname);
+ InitHaveFid();
+ }
+ Features features_;
+ void InitHaveFid() {
+ features_=FeatureFunction::single_feature(fid_);
+ }
+
Impl const& d() const { return static_cast<Impl const&>(*this); }
Impl & d() { return static_cast<Impl &>(*this); }
protected:
@@ -81,16 +91,6 @@ protected:
end_phrase_=singleton_sentence(single);
}
- // CALL 1 of these MANUALLY (because feature name(s) may depend on param, it's not done in ctor)
- void InitFidNamed(std::string const& fname="") {
- fid_=FD::Convert(name.empty()?name():fname);
- Init();
- }
- Features features_;
- void Init() {
- features_=FeatureFunction::single_feature(fid_);
- }
-
inline void static to_state(void *state,char const* begin,char const* end) {
std::memcpy(state,begin,end-begin);
}