diff options
author | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-19 21:30:41 +0400 |
---|---|---|
committer | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-19 21:30:41 +0400 |
commit | 686478a64dc1a9e4c98a51cd7a76fef3e2edf729 (patch) | |
tree | 7870587c9976abcc8c450b55ac543d83e7701783 /moses | |
parent | 3ffc86b4ebc1d5c6873d89602c71a575fbda8aa4 (diff) |
backwards compat. for pp
Diffstat (limited to 'moses')
-rw-r--r-- | moses/src/StaticData.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp index 95e22e4da..8e49f3a9e 100644 --- a/moses/src/StaticData.cpp +++ b/moses/src/StaticData.cpp @@ -1677,13 +1677,17 @@ bool StaticData::LoadPhrasePairFeature() return false; } vector<string> tokens = Tokenize(phrasePairFactors[0]); - if (tokens.size() != 1 && tokens.size() != 3) { + if (tokens.size() != 1 && tokens.size() != 2 && tokens.size() != 3) { UserMessage::Add("Format for phrase pair feature: --phrase-pair-feature <factor-src>-<factor-tgt> " "[simple source-trigger]"); return false; } - vector <string> factors = Tokenize(tokens[0],"-"); + vector <string> factors; + if (tokens.size() == 2) + factors = Tokenize(tokens[0]," "); + else + factors = Tokenize(tokens[0],"-"); size_t sourceFactorId = Scan<size_t>(factors[0]); size_t targetFactorId = Scan<size_t>(factors[1]); bool simple = true; |