diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2016-01-20 21:44:01 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2016-01-20 21:44:01 +0300 |
commit | 2ab4e0f2fec93baa89152c3149d19baf469a9c22 (patch) | |
tree | 1cb7759281a6df6cdb1ad93e23dcfc2354ceb261 /moses/TranslationModel | |
parent | ffdc9711e908fd70688180afe4a7f853447a0280 (diff) |
Look-up phrases with context weights.
Diffstat (limited to 'moses/TranslationModel')
-rw-r--r-- | moses/TranslationModel/UG/ptable-lookup-corpus.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/moses/TranslationModel/UG/ptable-lookup-corpus.cc b/moses/TranslationModel/UG/ptable-lookup-corpus.cc index 6bc515658..8818570d4 100644 --- a/moses/TranslationModel/UG/ptable-lookup-corpus.cc +++ b/moses/TranslationModel/UG/ptable-lookup-corpus.cc @@ -29,6 +29,13 @@ int main(int argc, char const* argv[]) // Only lookup each phrase once unordered_set<string> seen; + string context_weight_spec; + params.SetParameter(context_weight_spec,"context-weights",string("")); + boost::shared_ptr<ContextScope> scope(new ContextScope); + boost::shared_ptr<IOWrapper> none; + if (context_weight_spec.size()) + scope->SetContextWeights(context_weight_spec); + string line; while (true) { // Input line @@ -57,7 +64,8 @@ int main(int argc, char const* argv[]) // Setup task for phrase boost::shared_ptr<TranslationTask> ttask; - ttask = TranslationTask::create(phrase); + ttask = TranslationTask::create(phrase, none, scope); + // Support model combinations (PhraseDictionaryGroup) BOOST_FOREACH(PhraseDictionary* p, PhraseDictionary::GetColl()) { p->InitializeForInput(ttask); |