From 64aac199c4a8821772dfaaaa9d162f4a3f5bf121 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Thu, 2 Apr 2015 14:06:02 +0200 Subject: enable translation or learning: dtrain_net_interface --- training/dtrain/dtrain_net.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'training/dtrain/dtrain_net.cc') 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 parts; boost::algorithm::split_regex(parts, in, boost::regex(" \\|\\|\\| ")); - source = parts[0]; - parts.erase(parts.begin()); - for (auto s: parts) { - vector r; - vector 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 r; + vector 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()); + } } } } -- cgit v1.2.3