diff options
author | Eva <eva@deimos.(none)> | 2012-03-19 06:46:20 +0400 |
---|---|---|
committer | Eva <eva@deimos.(none)> | 2012-03-19 06:46:20 +0400 |
commit | 2983c4508418ba5692dd840e36cc332893fd3e19 (patch) | |
tree | b5588aeb250f8b2a198a4015e43b235c04c4050b /moses | |
parent | 054fd588df784b8fef0466717466609e7adf21dc (diff) | |
parent | 7d90efeb06a26b113fa6102329169830718e2b92 (diff) |
Merge branch 'miramerge' of thor.inf.ed.ac.uk:/fs/saxnot3/ehasler/mosesdecoder_github_mira into miramerge
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); } } |