#include #include "ff.h" #include "ff_lm.h" #include "ff_klm.h" #include "ff_csplit.h" #include "ff_wordalign.h" #include "ff_tagger.h" #include "ff_factory.h" #include "ff_ruleshape.h" #include "ff_bleu.h" #include "ff_lm_fsa.h" #include "ff_sample_fsa.h" #include "ff_register.h" #include "ff_charset.h" #include "ff_wordset.h" #ifdef HAVE_GLC #include #endif void register_feature_functions() { static bool registered = false; if (registered) { assert(!"register_feature_functions() called twice!"); } registered = true; //TODO: these are worthless example target FSA ffs. remove later RegisterFsaImpl(true); RegisterFsaImpl(true); RegisterFsaImpl(true); // ff_registry.Register("LanguageModelFsaDynamic",new FFFactory > >); // to test correctness of FsaFeatureFunctionDynamic erasure RegisterFsaDynToFF(); RegisterFsaImpl(true); // same as LM but using fsa wrapper RegisterFsaDynToFF(); RegisterFF(); RegisterFF(); RegisterFF(); RegisterFF(); RegisterFF(); ff_registry.Register(new FFFactory); // same as WordPenalty, but implemented using ff_fsa //TODO: use for all features the new Register which requires static FF::usage(false,false) give name #ifdef HAVE_RANDLM ff_registry.Register("RandLM", new FFFactory); #endif ff_registry.Register("KLanguageModel", new FFFactory >()); ff_registry.Register("KLanguageModel_Sorted", new FFFactory >()); ff_registry.Register("KLanguageModel_Trie", new FFFactory >()); ff_registry.Register("KLanguageModel_Probing", new FFFactory >()); ff_registry.Register("NonLatinCount", new FFFactory); ff_registry.Register("RuleShape", new FFFactory); ff_registry.Register("RelativeSentencePosition", new FFFactory); ff_registry.Register("LexNullJump", new FFFactory); ff_registry.Register("NewJump", new FFFactory); ff_registry.Register("SourceBigram", new FFFactory); ff_registry.Register("Fertility", new FFFactory); ff_registry.Register("BlunsomSynchronousParseHack", new FFFactory); ff_registry.Register("CSplit_BasicFeatures", new FFFactory); ff_registry.Register("CSplit_ReverseCharLM", new FFFactory); ff_registry.Register("Tagger_BigramIndicator", new FFFactory); ff_registry.Register("LexicalPairIndicator", new FFFactory); ff_registry.Register("OutputIndicator", new FFFactory); ff_registry.Register("IdentityCycleDetector", new FFFactory); ff_registry.Register("InputIndicator", new FFFactory); ff_registry.Register("LexicalTranslationTrigger", new FFFactory); ff_registry.Register("WordPairFeatures", new FFFactory); ff_registry.Register("WordSet", new FFFactory); #ifdef HAVE_GLC ff_registry.Register("ContextCRF", new FFFactory); #endif }