diff options
author | Patrick Simianer <p@simianer.de> | 2015-05-08 21:43:45 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-05-08 21:43:45 +0200 |
commit | d0b8fa29b83e6424e6d5848dbc42734b03896304 (patch) | |
tree | b1f2529183e99b92b20f972d3c5e6739ad855adf /training/dtrain/dtrain_net.cc | |
parent | f678b442e8a0c2e685652d2b7006ccccce989c81 (diff) | |
parent | 64aac199c4a8821772dfaaaa9d162f4a3f5bf121 (diff) |
Merge branch 'net' of github.com:pks/cdec-dtrain into net
Diffstat (limited to 'training/dtrain/dtrain_net.cc')
-rw-r--r-- | training/dtrain/dtrain_net.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/training/dtrain/dtrain_net.cc b/training/dtrain/dtrain_net.cc index 946b7587..306da957 100644 --- a/training/dtrain/dtrain_net.cc +++ b/training/dtrain/dtrain_net.cc @@ -67,16 +67,19 @@ main(int argc, char** argv) } else { vector<string> parts; boost::algorithm::split_regex(parts, in, boost::regex(" \\|\\|\\| ")); - source = parts[0]; - parts.erase(parts.begin()); - for (auto s: parts) { - vector<WordID> r; - vector<string> toks; - boost::split(toks, s, boost::is_any_of(" ")); - for (auto tok: toks) - r.push_back(TD::Convert(tok)); - refs.emplace_back(MakeNgrams(r, N)); - rsz.push_back(r.size()); + if (parts[0] == "act:translate") { + } else { + source = parts[0]; + parts.erase(parts.begin()); + for (auto s: parts) { + vector<WordID> r; + vector<string> toks; + boost::split(toks, s, boost::is_any_of(" ")); + for (auto tok: toks) + r.push_back(TD::Convert(tok)); + refs.emplace_back(MakeNgrams(r, N)); + rsz.push_back(r.size()); + } } } } |