diff options
author | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-18 22:00:13 +0400 |
---|---|---|
committer | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-18 22:00:13 +0400 |
commit | 7d90efeb06a26b113fa6102329169830718e2b92 (patch) | |
tree | 4d8ebc1f103e1837c45e5a6a98209b587d53ab6a /moses | |
parent | 4bc3982da7367138c315cbff8acace85a072d048 (diff) |
fix order of word translation features
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/WordTranslationFeature.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/moses/src/WordTranslationFeature.cpp b/moses/src/WordTranslationFeature.cpp index 90bd4ab2f..3e1dfa766 100644 --- a/moses/src/WordTranslationFeature.cpp +++ b/moses/src/WordTranslationFeature.cpp @@ -90,10 +90,10 @@ FFState* WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, const FFSt // add <s> trigger feature for source stringstream feature; feature << "wt_"; - feature << targetWord; + feature << "<s>,"; + feature << sourceWord; feature << "~"; - feature << "<s>,"; - feature << sourceWord; + feature << targetWord; accumulator->SparsePlusEquals(feature.str(), 1); } @@ -108,8 +108,6 @@ FFState* WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, const FFSt if (m_unrestricted || sourceTriggerExists) { stringstream feature; feature << "wt_"; - feature << targetWord; - feature << "~"; if (contextIndex < globalSourceIndex) { feature << sourceTrigger; feature << ","; @@ -120,6 +118,8 @@ FFState* WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, const FFSt feature << ","; feature << sourceTrigger; } + feature << "~"; + feature << targetWord; accumulator->SparsePlusEquals(feature.str(), 1); } } @@ -130,10 +130,10 @@ FFState* WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, const FFSt // add <s> trigger feature for source stringstream feature; feature << "wt_"; + feature << sourceWord; + feature << "~"; feature << "<s>,"; feature << targetWord; - feature << "~"; - feature << sourceWord; accumulator->SparsePlusEquals(feature.str(), 1); } @@ -147,11 +147,11 @@ FFState* WordTranslationFeature::Evaluate(const Hypothesis& cur_hypo, const FFSt if (m_unrestricted || targetTriggerExists) { stringstream feature; feature << "wt_"; + feature << sourceWord; + feature << "~"; feature << targetTrigger; feature << ","; feature << targetWord; - feature << "~"; - feature << sourceWord; accumulator->SparsePlusEquals(feature.str(), 1); } } |