From 76a8674a20692ecc4ac244d311e411eea61c1cc0 Mon Sep 17 00:00:00 2001 From: redpony Date: Wed, 13 Oct 2010 16:22:54 +0000 Subject: trigger ff, max iteration for online optimizer git-svn-id: https://ws10smt.googlecode.com/svn/trunk@671 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff_wordalign.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'decoder/ff_wordalign.h') diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h index ebbecfea..0754d70e 100644 --- a/decoder/ff_wordalign.h +++ b/decoder/ff_wordalign.h @@ -78,6 +78,7 @@ class MarkovJumpFClass : public FeatureFunction { typedef std::map Class2FID; typedef std::map Class2Class2FID; +typedef std::map Class2Class2Class2FID; class SourceBigram : public FeatureFunction { public: SourceBigram(const std::string& param); @@ -118,6 +119,26 @@ class SourcePOSBigram : public FeatureFunction { std::vector > pos_; }; +class LexicalTranslationTrigger : public FeatureFunction { + public: + LexicalTranslationTrigger(const std::string& param); + protected: + virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta, + const Hypergraph::Edge& edge, + const std::vector& ant_contexts, + SparseVector* features, + SparseVector* estimated_features, + void* context) const; + private: + void FireFeature(WordID trigger, + WordID src, + WordID trg, + SparseVector* features) const; + mutable Class2Class2Class2FID fmap_; // trigger,src,trg + mutable Class2Class2FID target_fmap_; // trigger,src,trg + std::vector > triggers_; +}; + class AlignerResults : public FeatureFunction { public: AlignerResults(const std::string& param); -- cgit v1.2.3