diff options
author | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-04-30 08:05:11 +0300 |
---|---|---|
committer | Jeroen Vermeulen <jtv@precisiontranslationtools.com> | 2015-04-30 08:05:11 +0300 |
commit | eca582410006443d0b101a9ae188e302f34f8a03 (patch) | |
tree | 35212762fbe666330205e2a9ef09d16a918d077c /moses/TranslationTask.cpp | |
parent | 85acdc62b1548863a6db18bebb538406cfcfa038 (diff) |
Remove trailing whitespace in C++ files.
Diffstat (limited to 'moses/TranslationTask.cpp')
-rw-r--r-- | moses/TranslationTask.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/moses/TranslationTask.cpp b/moses/TranslationTask.cpp index acb84c434..764ca998a 100644 --- a/moses/TranslationTask.cpp +++ b/moses/TranslationTask.cpp @@ -30,16 +30,16 @@ TranslationTask return m_context_string; } -void +void TranslationTask -::SetContextString(std::string const& context) +::SetContextString(std::string const& context) { m_context_string = context; } -boost::shared_ptr<TranslationTask> +boost::shared_ptr<TranslationTask> TranslationTask ::create(boost::shared_ptr<InputType> const& source) { @@ -50,9 +50,9 @@ TranslationTask return ret; } -boost::shared_ptr<TranslationTask> +boost::shared_ptr<TranslationTask> TranslationTask -::create(boost::shared_ptr<InputType> const& source, +::create(boost::shared_ptr<InputType> const& source, boost::shared_ptr<IOWrapper> const& ioWrapper) { boost::shared_ptr<TranslationTask> ret(new TranslationTask(source, ioWrapper)); @@ -62,7 +62,7 @@ TranslationTask } TranslationTask -::TranslationTask(boost::shared_ptr<InputType> const& source, +::TranslationTask(boost::shared_ptr<InputType> const& source, boost::shared_ptr<IOWrapper> const& ioWrapper) : m_source(source) , m_ioWrapper(ioWrapper) { } @@ -73,52 +73,52 @@ TranslationTask::~TranslationTask() boost::shared_ptr<BaseManager> TranslationTask -::SetupManager(SearchAlgorithm algo) +::SetupManager(SearchAlgorithm algo) { boost::shared_ptr<BaseManager> manager; StaticData const& staticData = StaticData::Instance(); if (algo == DefaultSearchAlgorithm) algo = staticData.GetSearchAlgorithm(); - if (!staticData.IsSyntax(algo)) + if (!staticData.IsSyntax(algo)) manager.reset(new Manager(this->self())); // phrase-based - else if (algo == SyntaxF2S || algo == SyntaxT2S) + else if (algo == SyntaxF2S || algo == SyntaxT2S) { // STSG-based tree-to-string / forest-to-string decoding (ask Phil Williams) typedef Syntax::F2S::RuleMatcherCallback Callback; typedef Syntax::F2S::RuleMatcherHyperTree<Callback> RuleMatcher; manager.reset(new Syntax::F2S::Manager<RuleMatcher>(this->self())); - } + } - else if (algo == SyntaxS2T) + else if (algo == SyntaxS2T) { // new-style string-to-tree decoding (ask Phil Williams) S2TParsingAlgorithm algorithm = staticData.GetS2TParsingAlgorithm(); - if (algorithm == RecursiveCYKPlus) + if (algorithm == RecursiveCYKPlus) { typedef Syntax::S2T::EagerParserCallback Callback; typedef Syntax::S2T::RecursiveCYKPlusParser<Callback> Parser; manager.reset(new Syntax::S2T::Manager<Parser>(this->self())); - } - else if (algorithm == Scope3) + } + else if (algorithm == Scope3) { typedef Syntax::S2T::StandardParserCallback Callback; typedef Syntax::S2T::Scope3Parser<Callback> Parser; manager.reset(new Syntax::S2T::Manager<Parser>(this->self())); - } + } else UTIL_THROW2("ERROR: unhandled S2T parsing algorithm"); - } + } - else if (algo == SyntaxT2S_SCFG) + else if (algo == SyntaxT2S_SCFG) { // SCFG-based tree-to-string decoding (ask Phil Williams) typedef Syntax::F2S::RuleMatcherCallback Callback; typedef Syntax::T2S::RuleMatcherSCFG<Callback> RuleMatcher; manager.reset(new Syntax::T2S::Manager<RuleMatcher>(this->self())); - } + } else if (algo == ChartIncremental) // Ken's incremental decoding manager.reset(new Incremental::Manager(this->self())); else // original SCFG manager - manager.reset(new ChartManager(this->self())); + manager.reset(new ChartManager(this->self())); return manager; } @@ -151,17 +151,17 @@ void TranslationTask::Run() boost::shared_ptr<BaseManager> manager = SetupManager(); - VERBOSE(1, "Line " << translationId << ": Initialize search took " + VERBOSE(1, "Line " << translationId << ": Initialize search took " << initTime << " seconds total" << endl); manager->Decode(); - // new: stop here if m_ioWrapper is NULL. This means that the + // new: stop here if m_ioWrapper is NULL. This means that the // owner of the TranslationTask will take care of the output // oh, and by the way, all the output should be handled by the // output wrapper along the lines of *m_iwWrapper << *manager; // Just sayin' ... - if (m_ioWrapper == NULL) return; + if (m_ioWrapper == NULL) return; // we are done with search, let's look what we got OutputCollector* ocoll; @@ -182,7 +182,7 @@ void TranslationTask::Run() // Output search graph in hypergraph format for Kenneth Heafield's // lazy hypergraph decoder; writes to stderr - manager->OutputSearchGraphHypergraph(); + manager->OutputSearchGraphHypergraph(); additionalReportingTime.stop(); @@ -208,9 +208,9 @@ void TranslationTask::Run() // report additional statistics manager->CalcDecoderStatistics(); - VERBOSE(1, "Line " << translationId << ": Additional reporting took " + VERBOSE(1, "Line " << translationId << ": Additional reporting took " << additionalReportingTime << " seconds total" << endl); - VERBOSE(1, "Line " << translationId << ": Translation took " + VERBOSE(1, "Line " << translationId << ": Translation took " << translationTime << " seconds total" << endl); IFVERBOSE(2) { PrintUserTime("Sentence Decoding Time:"); |