From d757346b55cf497f7a6887b00c1a84402f33f374 Mon Sep 17 00:00:00 2001 From: MosesAdmin Date: Mon, 19 Oct 2015 00:00:40 +0100 Subject: [PATCH] daily automatic beautifier --- OnDiskPt/PhraseNode.cpp | 2 +- OnDiskPt/PhraseNode.h | 8 ++--- OnDiskPt/TargetPhraseCollection.cpp | 6 ++-- OnDiskPt/TargetPhraseCollection.h | 2 +- defer/PhraseDictionaryInterpolated.cpp | 2 +- moses/ChartParser.h | 2 +- moses/ChartTranslationOptionList.cpp | 8 ++--- moses/DecodeStepTranslation.cpp | 6 ++-- moses/Hypothesis.h | 2 +- moses/InputPath.cpp | 22 ++++++------ moses/InputPath.h | 22 ++++++------ moses/PDTAimp.cpp | 8 ++--- moses/Syntax/F2S/GlueRuleSynthesizer.cpp | 4 +-- moses/Syntax/F2S/HyperTree.h | 6 ++-- moses/Syntax/F2S/HyperTreeLoader.cpp | 4 +-- moses/Syntax/F2S/RuleMatcherHyperTree-inl.h | 4 +-- moses/Syntax/S2T/OovHandler-inl.h | 2 +- .../Scope3Parser/TailLatticeSearcher.h | 4 +-- moses/Syntax/S2T/RuleTrie.h | 8 ++--- moses/Syntax/S2T/RuleTrieCYKPlus.cpp | 8 ++--- moses/Syntax/S2T/RuleTrieCYKPlus.h | 4 +-- moses/Syntax/S2T/RuleTrieCreator.h | 4 +-- moses/Syntax/S2T/RuleTrieLoader.cpp | 6 ++-- moses/Syntax/S2T/RuleTrieScope3.cpp | 6 ++-- moses/Syntax/S2T/RuleTrieScope3.h | 12 +++---- moses/Syntax/T2S/GlueRuleSynthesizer.cpp | 4 +-- moses/Syntax/T2S/RuleTrie.cpp | 8 ++--- moses/Syntax/T2S/RuleTrie.h | 10 +++--- moses/Syntax/T2S/RuleTrieLoader.cpp | 8 ++--- ...hartRuleLookupManagerMemoryPerSentence.cpp | 4 +-- .../ChartRuleLookupManagerOnDisk.cpp | 6 ++-- .../CompactPT/PhraseDictionaryCompact.cpp | 2 +- moses/TranslationModel/PhraseDictionary.cpp | 10 +++--- moses/TranslationModel/PhraseDictionary.h | 16 ++++----- .../PhraseDictionaryDynamicCacheBased.h | 2 +- .../PhraseDictionaryGroup.cpp | 18 +++++----- .../TranslationModel/PhraseDictionaryGroup.h | 6 ++-- .../PhraseDictionaryMemory.cpp | 14 ++++---- .../TranslationModel/PhraseDictionaryMemory.h | 10 +++--- .../PhraseDictionaryMultiModel.cpp | 36 +++++++++---------- .../PhraseDictionaryMultiModel.h | 34 +++++++++--------- .../PhraseDictionaryMultiModelCounts.cpp | 10 +++--- .../PhraseDictionaryNodeMemory.h | 8 ++--- .../PhraseDictionaryTransliteration.cpp | 6 ++-- .../PhraseDictionaryTreeAdaptor.h | 6 ++-- moses/TranslationModel/RuleTable/Loader.h | 13 ++++--- .../RuleTable/LoaderCompact.cpp | 4 +-- .../RuleTable/LoaderStandard.cpp | 6 ++-- .../RuleTable/PhraseDictionaryFuzzyMatch.cpp | 14 ++++---- .../RuleTable/PhraseDictionaryFuzzyMatch.h | 8 ++--- .../RuleTable/PhraseDictionaryOnDisk.cpp | 18 +++++----- .../RuleTable/PhraseDictionaryOnDisk.h | 4 +-- moses/TranslationModel/RuleTable/Trie.h | 8 ++--- moses/TranslationModel/RuleTable/UTrie.cpp | 8 ++--- moses/TranslationModel/RuleTable/UTrie.h | 8 ++--- moses/TranslationModel/RuleTable/UTrieNode.h | 4 +-- .../TranslationModel/Scope3Parser/Parser.cpp | 6 ++-- moses/TranslationModel/Scope3Parser/Parser.h | 2 +- moses/TranslationModel/SkeletonPT.cpp | 4 +-- moses/TranslationOptionCollectionLattice.cpp | 12 +++---- moses/Util.h | 2 +- 61 files changed, 249 insertions(+), 252 deletions(-) diff --git a/OnDiskPt/PhraseNode.cpp b/OnDiskPt/PhraseNode.cpp index 74e01d457..b77e8d807 100644 --- a/OnDiskPt/PhraseNode.cpp +++ b/OnDiskPt/PhraseNode.cpp @@ -249,7 +249,7 @@ size_t PhraseNode::ReadChild(Word &wordFound, uint64_t &childFilePos, const char return memRead; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseNode:: GetTargetPhraseCollection(size_t tableLimit, OnDiskWrapper &onDiskWrapper) const { diff --git a/OnDiskPt/PhraseNode.h b/OnDiskPt/PhraseNode.h index 39b9b3f21..1e3611d74 100644 --- a/OnDiskPt/PhraseNode.h +++ b/OnDiskPt/PhraseNode.h @@ -93,10 +93,10 @@ public: const PhraseNode *GetChild(const Word &wordSought, OnDiskWrapper &onDiskWrapper) const; - TargetPhraseCollection::shared_ptr - GetTargetPhraseCollection(size_t tableLimit, - OnDiskWrapper &onDiskWrapper) const; - + TargetPhraseCollection::shared_ptr + GetTargetPhraseCollection(size_t tableLimit, + OnDiskWrapper &onDiskWrapper) const; + void AddCounts(const std::vector &counts) { m_counts = counts; } diff --git a/OnDiskPt/TargetPhraseCollection.cpp b/OnDiskPt/TargetPhraseCollection.cpp index a22c3633b..8d06af163 100644 --- a/OnDiskPt/TargetPhraseCollection.cpp +++ b/OnDiskPt/TargetPhraseCollection.cpp @@ -127,9 +127,9 @@ Moses::TargetPhraseCollection::shared_ptr TargetPhraseCollection::ConvertToMoses CollType::const_iterator iter; for (iter = m_coll.begin(); iter != m_coll.end(); ++iter) { const TargetPhrase &tp = **iter; - Moses::TargetPhrase *mosesPhrase - = tp.ConvertToMoses(inputFactors, outputFactors, vocab, - phraseDict, weightT, isSyntax); + Moses::TargetPhrase *mosesPhrase + = tp.ConvertToMoses(inputFactors, outputFactors, vocab, + phraseDict, weightT, isSyntax); /* // debugging output diff --git a/OnDiskPt/TargetPhraseCollection.h b/OnDiskPt/TargetPhraseCollection.h index 255c94054..1dd37fd4e 100644 --- a/OnDiskPt/TargetPhraseCollection.h +++ b/OnDiskPt/TargetPhraseCollection.h @@ -54,7 +54,7 @@ protected: public: typedef boost::shared_ptr shared_const_ptr; typedef boost::shared_ptr shared_ptr; - + static size_t s_sortScoreInd; TargetPhraseCollection(); diff --git a/defer/PhraseDictionaryInterpolated.cpp b/defer/PhraseDictionaryInterpolated.cpp index 6b3d9cf0b..892e5f98f 100644 --- a/defer/PhraseDictionaryInterpolated.cpp +++ b/defer/PhraseDictionaryInterpolated.cpp @@ -116,7 +116,7 @@ typedef boost::unordered_set PhraseSet; -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryInterpolated::GetTargetPhraseCollection(const Phrase& src) const { diff --git a/moses/ChartParser.h b/moses/ChartParser.h index 2fb25dd0c..a1d0752c2 100644 --- a/moses/ChartParser.h +++ b/moses/ChartParser.h @@ -38,7 +38,7 @@ class Sentence; class ChartCellCollectionBase; class Word; class Phrase; - // class TargetPhraseCollection; +// class TargetPhraseCollection; class DecodeGraph; class ChartParserUnknown diff --git a/moses/ChartTranslationOptionList.cpp b/moses/ChartTranslationOptionList.cpp index 8af2b124d..1d5c261bc 100644 --- a/moses/ChartTranslationOptionList.cpp +++ b/moses/ChartTranslationOptionList.cpp @@ -115,11 +115,11 @@ void ChartTranslationOptionList::Add(const TargetPhraseCollection &tpc, } } -void +void ChartTranslationOptionList:: -AddPhraseOOV(TargetPhrase &phrase, - std::list &waste_memory, - const WordsRange &range) +AddPhraseOOV(TargetPhrase &phrase, + std::list &waste_memory, + const WordsRange &range) { TargetPhraseCollection::shared_ptr tpc(new TargetPhraseCollection); tpc->Add(&phrase); diff --git a/moses/DecodeStepTranslation.cpp b/moses/DecodeStepTranslation.cpp index f2a5722e1..071dd1cab 100644 --- a/moses/DecodeStepTranslation.cpp +++ b/moses/DecodeStepTranslation.cpp @@ -147,8 +147,8 @@ void DecodeStepTranslation::ProcessInitialTranslationLEGACY( const size_t tableLimit = phraseDictionary->GetTableLimit(); const WordsRange wordsRange(startPos, endPos); - TargetPhraseCollectionWithSourcePhrase::shared_ptr phraseColl - = phraseDictionary->GetTargetPhraseCollectionLEGACY(source,wordsRange); + TargetPhraseCollectionWithSourcePhrase::shared_ptr phraseColl + = phraseDictionary->GetTargetPhraseCollectionLEGACY(source,wordsRange); if (phraseColl != NULL) { IFVERBOSE(3) { @@ -239,7 +239,7 @@ ProcessLEGACY(TranslationOption const& in, size_t const tableLimit = pdict->GetTableLimit(); TargetPhraseCollectionWithSourcePhrase::shared_ptr phraseColl - = pdict->GetTargetPhraseCollectionLEGACY(toc->GetSource(),srcRange); + = pdict->GetTargetPhraseCollectionLEGACY(toc->GetSource(),srcRange); if (phraseColl != NULL) { TargetPhraseCollection::const_iterator iterTargetPhrase, iterEnd; diff --git a/moses/Hypothesis.h b/moses/Hypothesis.h index caff9b397..07c69379b 100644 --- a/moses/Hypothesis.h +++ b/moses/Hypothesis.h @@ -314,7 +314,7 @@ struct CompareHypothesisTotalScore { ObjectPool &pool = Hypothesis::GetObjectPool(); \ pool.freeObject(hypo); \ } \ - + #else #define FREEHYPO(hypo) delete hypo #endif diff --git a/moses/InputPath.cpp b/moses/InputPath.cpp index 504b84605..b57d70704 100644 --- a/moses/InputPath.cpp +++ b/moses/InputPath.cpp @@ -11,12 +11,12 @@ using namespace std; namespace Moses { InputPath:: -InputPath(ttaskwptr const theTask, - Phrase const& phrase, - NonTerminalSet const& sourceNonTerms, +InputPath(ttaskwptr const theTask, + Phrase const& phrase, + NonTerminalSet const& sourceNonTerms, WordsRange const& range, InputPath const *prevNode, const ScorePair *inputScore) - : ttask(theTask) + : ttask(theTask) , m_prevPath(prevNode) , m_phrase(phrase) , m_range(range) @@ -36,7 +36,7 @@ InputPath(ttaskwptr const theTask, InputPath::~InputPath() { - + // std::cerr << "Deconstructing InputPath" << std::endl; @@ -80,14 +80,14 @@ GetPtNode(const PhraseDictionary &phraseDictionary) const return iter->second.second; } -void +void InputPath:: -SetTargetPhrases(const PhraseDictionary &phraseDictionary, - TargetPhraseCollection::shared_ptr const& targetPhrases, - const void *ptNode) +SetTargetPhrases(const PhraseDictionary &phraseDictionary, + TargetPhraseCollection::shared_ptr const& targetPhrases, + const void *ptNode) { - std::pair - value(targetPhrases, ptNode); + std::pair + value(targetPhrases, ptNode); m_targetPhrases[&phraseDictionary] = value; } diff --git a/moses/InputPath.h b/moses/InputPath.h index e379b8630..84dd22a26 100644 --- a/moses/InputPath.h +++ b/moses/InputPath.h @@ -33,10 +33,10 @@ class InputPath public: - typedef std::pair + typedef std::pair TPCollStoreEntry; - typedef std::map + typedef std::map TargetPhrases; public: @@ -65,12 +65,12 @@ public: , m_nextNode(NOT_FOUND) { } - InputPath(ttaskwptr const ttask, - Phrase const& phrase, - NonTerminalSet const& sourceNonTerms, - WordsRange const& range, - InputPath const* prevNode, - ScorePair const* inputScore); + InputPath(ttaskwptr const ttask, + Phrase const& phrase, + NonTerminalSet const& sourceNonTerms, + WordsRange const& range, + InputPath const* prevNode, + ScorePair const* inputScore); ~InputPath(); @@ -101,9 +101,9 @@ public: m_nextNode = nextNode; } - void - SetTargetPhrases(const PhraseDictionary &phraseDictionary, - TargetPhraseCollection::shared_ptr const& targetPhrases, + void + SetTargetPhrases(const PhraseDictionary &phraseDictionary, + TargetPhraseCollection::shared_ptr const& targetPhrases, const void *ptNode); TargetPhraseCollection::shared_ptr diff --git a/moses/PDTAimp.cpp b/moses/PDTAimp.cpp index ea40a2f4f..c4bd2c338 100644 --- a/moses/PDTAimp.cpp +++ b/moses/PDTAimp.cpp @@ -149,7 +149,7 @@ PDTAimp::GetTargetPhraseCollection(Phrase const &src) const if(useCache) piter.first->second = ret; m_tgtColls.push_back(ret); } - return ret; + return ret; } @@ -387,8 +387,8 @@ void PDTAimp::CacheSource(ConfusionNet const& src) //std::cerr << i->first.first << "-" << i->first.second << ": " << targetPhrase << std::endl; } - TargetPhraseCollectionWithSourcePhrase::shared_ptr - rv = PruneTargetCandidates(tCands, costs, sourcePhrases); + TargetPhraseCollectionWithSourcePhrase::shared_ptr + rv = PruneTargetCandidates(tCands, costs, sourcePhrases); if(rv->IsEmpty()) rv.reset(); @@ -430,7 +430,7 @@ void PDTAimp::CreateTargetPhrase(TargetPhrase& targetPhrase, targetPhrase.EvaluateInIsolation(*srcPtr, m_obj->GetFeaturesToApply()); } -TargetPhraseCollectionWithSourcePhrase::shared_ptr +TargetPhraseCollectionWithSourcePhrase::shared_ptr PDTAimp::PruneTargetCandidates (const std::vector & tCands, std::vector >& costs, diff --git a/moses/Syntax/F2S/GlueRuleSynthesizer.cpp b/moses/Syntax/F2S/GlueRuleSynthesizer.cpp index e83daa81b..3ba5a26d3 100644 --- a/moses/Syntax/F2S/GlueRuleSynthesizer.cpp +++ b/moses/Syntax/F2S/GlueRuleSynthesizer.cpp @@ -28,8 +28,8 @@ void GlueRuleSynthesizer::SynthesizeRule(const Forest::Hyperedge &e) HyperPath source; SynthesizeHyperPath(e, source); TargetPhrase *tp = SynthesizeTargetPhrase(e); - TargetPhraseCollection::shared_ptr tpc - = GetOrCreateTargetPhraseCollection(m_hyperTree, source); + TargetPhraseCollection::shared_ptr tpc + = GetOrCreateTargetPhraseCollection(m_hyperTree, source); tpc->Add(tp); } diff --git a/moses/Syntax/F2S/HyperTree.h b/moses/Syntax/F2S/HyperTree.h index a000e9f9b..8e33451a8 100644 --- a/moses/Syntax/F2S/HyperTree.h +++ b/moses/Syntax/F2S/HyperTree.h @@ -47,12 +47,12 @@ public: const Node *GetChild(const HyperPath::NodeSeq &) const; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() const { return m_targetPhraseCollection; } - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() { return m_targetPhraseCollection; } @@ -77,7 +77,7 @@ public: private: friend class HyperTreeCreator; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(const HyperPath &); Node &GetOrCreateNode(const HyperPath &); diff --git a/moses/Syntax/F2S/HyperTreeLoader.cpp b/moses/Syntax/F2S/HyperTreeLoader.cpp index 6764963ac..aefddbc2d 100644 --- a/moses/Syntax/F2S/HyperTreeLoader.cpp +++ b/moses/Syntax/F2S/HyperTreeLoader.cpp @@ -130,8 +130,8 @@ bool HyperTreeLoader::Load(const std::vector &input, ff.GetFeaturesToApply()); // Add rule to trie. - TargetPhraseCollection::shared_ptr phraseColl - = GetOrCreateTargetPhraseCollection(trie, sourceFragment); + TargetPhraseCollection::shared_ptr phraseColl + = GetOrCreateTargetPhraseCollection(trie, sourceFragment); phraseColl->Add(targetPhrase); count++; diff --git a/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h b/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h index bf05d4bcc..36dfeced2 100644 --- a/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h +++ b/moses/Syntax/F2S/RuleMatcherHyperTree-inl.h @@ -51,8 +51,8 @@ void RuleMatcherHyperTree::EnumerateHyperedges( m_hyperedge.label.inputWeight += (*p)->weight; } // Set the output hyperedge label's translation set pointer. - m_hyperedge.label.translations - = item.trieNode->GetTargetPhraseCollection(); + m_hyperedge.label.translations + = item.trieNode->GetTargetPhraseCollection(); // Pass the output hyperedge to the callback. callback(m_hyperedge); } diff --git a/moses/Syntax/S2T/OovHandler-inl.h b/moses/Syntax/S2T/OovHandler-inl.h index e5ffe6370..9f26563d5 100644 --- a/moses/Syntax/S2T/OovHandler-inl.h +++ b/moses/Syntax/S2T/OovHandler-inl.h @@ -33,7 +33,7 @@ boost::shared_ptr OovHandler::SynthesizeRuleTrie( Word *tgtLHS = SynthesizeTargetLhs(targetLhsStr); TargetPhrase *tp = SynthesizeTargetPhrase(oov, *srcPhrase, *tgtLHS, prob); TargetPhraseCollection::shared_ptr tpc; - tpc= GetOrCreateTargetPhraseCollection(*trie, *srcPhrase, *tp, NULL); + tpc= GetOrCreateTargetPhraseCollection(*trie, *srcPhrase, *tp, NULL); // TODO Check NULL is valid argument tpc->Add(tp); } diff --git a/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h b/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h index 407f04d5b..5ee32553e 100644 --- a/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h +++ b/moses/Syntax/S2T/Parsers/Scope3Parser/TailLatticeSearcher.h @@ -25,8 +25,8 @@ public: , m_key(key) , m_ranges(ranges) {} - void Search(const std::vector &labels, - const TargetPhraseCollection::shared_ptr tpc, + void Search(const std::vector &labels, + const TargetPhraseCollection::shared_ptr tpc, Callback &callback) { m_labels = &labels; m_matchCB = &callback; diff --git a/moses/Syntax/S2T/RuleTrie.h b/moses/Syntax/S2T/RuleTrie.h index b9d031673..eee6edd5b 100644 --- a/moses/Syntax/S2T/RuleTrie.h +++ b/moses/Syntax/S2T/RuleTrie.h @@ -28,10 +28,10 @@ public: private: friend class RuleTrieCreator; - virtual TargetPhraseCollection::shared_ptr - GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) = 0; + virtual TargetPhraseCollection::shared_ptr + GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) = 0; virtual void SortAndPrune(std::size_t) = 0; }; diff --git a/moses/Syntax/S2T/RuleTrieCYKPlus.cpp b/moses/Syntax/S2T/RuleTrieCYKPlus.cpp index 7c8d08864..68da5f5b7 100644 --- a/moses/Syntax/S2T/RuleTrieCYKPlus.cpp +++ b/moses/Syntax/S2T/RuleTrieCYKPlus.cpp @@ -86,11 +86,11 @@ const RuleTrieCYKPlus::Node *RuleTrieCYKPlus::Node::GetNonTerminalChild( return (p == m_nonTermMap.end()) ? NULL : &p->second; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr RuleTrieCYKPlus:: -GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) +GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) { Node &currNode = GetOrCreateNode(source, target, sourceLHS); return currNode.GetTargetPhraseCollection(); diff --git a/moses/Syntax/S2T/RuleTrieCYKPlus.h b/moses/Syntax/S2T/RuleTrieCYKPlus.h index 0c11a1edb..31880e0ed 100644 --- a/moses/Syntax/S2T/RuleTrieCYKPlus.h +++ b/moses/Syntax/S2T/RuleTrieCYKPlus.h @@ -50,12 +50,12 @@ public: const Node *GetChild(const Word &sourceTerm) const; const Node *GetNonTerminalChild(const Word &targetNonTerm) const; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() const { return m_targetPhraseCollection; } - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() { return m_targetPhraseCollection; } diff --git a/moses/Syntax/S2T/RuleTrieCreator.h b/moses/Syntax/S2T/RuleTrieCreator.h index 62da519a1..84a4a1636 100644 --- a/moses/Syntax/S2T/RuleTrieCreator.h +++ b/moses/Syntax/S2T/RuleTrieCreator.h @@ -21,9 +21,9 @@ protected: // Provide access to RuleTrie's private GetOrCreateTargetPhraseCollection // function. - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection - ( RuleTrie &trie, const Phrase &source, const TargetPhrase &target, + ( RuleTrie &trie, const Phrase &source, const TargetPhrase &target, const Word *sourceLHS) { return trie.GetOrCreateTargetPhraseCollection(source, target, sourceLHS); } diff --git a/moses/Syntax/S2T/RuleTrieLoader.cpp b/moses/Syntax/S2T/RuleTrieLoader.cpp index b523953c7..3ac266bdb 100644 --- a/moses/Syntax/S2T/RuleTrieLoader.cpp +++ b/moses/Syntax/S2T/RuleTrieLoader.cpp @@ -125,9 +125,9 @@ bool RuleTrieLoader::Load(const std::vector &input, targetPhrase->GetScoreBreakdown().Assign(&ff, scoreVector); targetPhrase->EvaluateInIsolation(sourcePhrase, ff.GetFeaturesToApply()); - TargetPhraseCollection::shared_ptr phraseColl - = GetOrCreateTargetPhraseCollection(trie, sourcePhrase, - *targetPhrase, sourceLHS); + TargetPhraseCollection::shared_ptr phraseColl + = GetOrCreateTargetPhraseCollection(trie, sourcePhrase, + *targetPhrase, sourceLHS); phraseColl->Add(targetPhrase); // not implemented correctly in memory pt. just delete it for now diff --git a/moses/Syntax/S2T/RuleTrieScope3.cpp b/moses/Syntax/S2T/RuleTrieScope3.cpp index aecaac3f7..ceaee9501 100644 --- a/moses/Syntax/S2T/RuleTrieScope3.cpp +++ b/moses/Syntax/S2T/RuleTrieScope3.cpp @@ -102,9 +102,9 @@ GetOrCreateTargetPhraseCollection(const TargetPhrase &target) TargetPhraseCollection::shared_ptr RuleTrieScope3:: -GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) +GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) { Node &currNode = GetOrCreateNode(source, target, sourceLHS); return currNode.GetOrCreateTargetPhraseCollection(target); diff --git a/moses/Syntax/S2T/RuleTrieScope3.h b/moses/Syntax/S2T/RuleTrieScope3.h index 4684e8a78..97c939961 100644 --- a/moses/Syntax/S2T/RuleTrieScope3.h +++ b/moses/Syntax/S2T/RuleTrieScope3.h @@ -35,7 +35,7 @@ public: SymbolEqualityPred> TerminalMap; typedef boost::unordered_map, - TargetPhraseCollection::shared_ptr> LabelMap; + TargetPhraseCollection::shared_ptr> LabelMap; ~Node() { delete m_gapNode; @@ -61,7 +61,7 @@ public: Node *GetOrCreateNonTerminalChild(const Word &targetNonTerm); - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(const TargetPhrase &); bool IsLeaf() const { @@ -106,10 +106,10 @@ public: bool HasPreterminalRule(const Word &) const; private: - TargetPhraseCollection::shared_ptr - GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS); + TargetPhraseCollection::shared_ptr + GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS); Node &GetOrCreateNode(const Phrase &source, const TargetPhrase &target, const Word *sourceLHS); diff --git a/moses/Syntax/T2S/GlueRuleSynthesizer.cpp b/moses/Syntax/T2S/GlueRuleSynthesizer.cpp index 7514852f2..f50f84629 100644 --- a/moses/Syntax/T2S/GlueRuleSynthesizer.cpp +++ b/moses/Syntax/T2S/GlueRuleSynthesizer.cpp @@ -17,8 +17,8 @@ void GlueRuleSynthesizer::SynthesizeRule(const InputTree::Node &node) const Word &sourceLhs = node.pvertex.symbol; boost::scoped_ptr sourceRhs(SynthesizeSourcePhrase(node)); TargetPhrase *tp = SynthesizeTargetPhrase(node, *sourceRhs); - TargetPhraseCollection::shared_ptr tpc - = GetOrCreateTargetPhraseCollection(m_ruleTrie, sourceLhs, *sourceRhs); + TargetPhraseCollection::shared_ptr tpc + = GetOrCreateTargetPhraseCollection(m_ruleTrie, sourceLhs, *sourceRhs); tpc->Add(tp); } diff --git a/moses/Syntax/T2S/RuleTrie.cpp b/moses/Syntax/T2S/RuleTrie.cpp index e6fc5214c..fb5ae7108 100644 --- a/moses/Syntax/T2S/RuleTrie.cpp +++ b/moses/Syntax/T2S/RuleTrie.cpp @@ -76,15 +76,15 @@ GetOrCreateNonTerminalChild(const Word &targetNonTerm) return &m_nonTermMap[targetNonTerm]; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr RuleTrie:: Node:: GetOrCreateTargetPhraseCollection(const Word &sourceLHS) { UTIL_THROW_IF2(!sourceLHS.IsNonTerminal(), "Not a non-terminal: " << sourceLHS); - TargetPhraseCollection::shared_ptr& foo - = m_targetPhraseCollections[sourceLHS]; + TargetPhraseCollection::shared_ptr& foo + = m_targetPhraseCollections[sourceLHS]; if (!foo) foo.reset(new TargetPhraseCollection); return foo; } @@ -110,7 +110,7 @@ GetNonTerminalChild(const Word &targetNonTerm) const return (p == m_nonTermMap.end()) ? NULL : &p->second; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr RuleTrie:: GetOrCreateTargetPhraseCollection ( const Word &sourceLHS, const Phrase &sourceRHS ) diff --git a/moses/Syntax/T2S/RuleTrie.h b/moses/Syntax/T2S/RuleTrie.h index f9d857088..16b9e735f 100644 --- a/moses/Syntax/T2S/RuleTrie.h +++ b/moses/Syntax/T2S/RuleTrie.h @@ -53,13 +53,13 @@ public: const Node *GetChild(const Word &sourceTerm) const; const Node *GetNonTerminalChild(const Word &targetNonTerm) const; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection(const Word &sourceLHS) const { TPCMap::const_iterator p = m_targetPhraseCollections.find(sourceLHS); - if (p != m_targetPhraseCollections.end()) - return p->second; + if (p != m_targetPhraseCollections.end()) + return p->second; else - return TargetPhraseCollection::shared_ptr(); + return TargetPhraseCollection::shared_ptr(); } // FIXME IS there any reason to distinguish these two for T2S? @@ -86,7 +86,7 @@ public: private: friend class RuleTrieCreator; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection (const Word &sourceLHS, const Phrase &sourceRHS); diff --git a/moses/Syntax/T2S/RuleTrieLoader.cpp b/moses/Syntax/T2S/RuleTrieLoader.cpp index c96c52b03..f0646b1f7 100644 --- a/moses/Syntax/T2S/RuleTrieLoader.cpp +++ b/moses/Syntax/T2S/RuleTrieLoader.cpp @@ -56,8 +56,8 @@ bool RuleTrieLoader::Load(const std::vector &input, StringPiece line; int noflags = double_conversion::StringToDoubleConverter::NO_FLAGS; - double_conversion::StringToDoubleConverter - converter(noflags, NAN, NAN, "inf", "nan"); + double_conversion::StringToDoubleConverter + converter(noflags, NAN, NAN, "inf", "nan"); while(true) { try { @@ -134,8 +134,8 @@ bool RuleTrieLoader::Load(const std::vector &input, targetPhrase->GetScoreBreakdown().Assign(&ff, scoreVector); targetPhrase->EvaluateInIsolation(sourcePhrase, ff.GetFeaturesToApply()); - TargetPhraseCollection::shared_ptr phraseColl - = GetOrCreateTargetPhraseCollection(trie, *sourceLHS, sourcePhrase); + TargetPhraseCollection::shared_ptr phraseColl + = GetOrCreateTargetPhraseCollection(trie, *sourceLHS, sourcePhrase); phraseColl->Add(targetPhrase); // not implemented correctly in memory pt. just delete it for now diff --git a/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerMemoryPerSentence.cpp b/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerMemoryPerSentence.cpp index f81a21205..26ecb80e2 100644 --- a/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerMemoryPerSentence.cpp +++ b/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerMemoryPerSentence.cpp @@ -167,8 +167,8 @@ void ChartRuleLookupManagerMemoryPerSentence::AddAndExtend( size_t endPos) { - TargetPhraseCollection::shared_ptr tpc - = node->GetTargetPhraseCollection(); + TargetPhraseCollection::shared_ptr tpc + = node->GetTargetPhraseCollection(); // add target phrase collection (except if rule is empty or a unary non-terminal rule) if (!tpc->IsEmpty() && (m_stackVec.empty() || endPos != m_unaryPos)) { m_completedRules[endPos].Add(*tpc, m_stackVec, m_stackScores, *m_outColl); diff --git a/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerOnDisk.cpp b/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerOnDisk.cpp index 5b8c20d27..102fa82cf 100644 --- a/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerOnDisk.cpp +++ b/moses/TranslationModel/CYKPlusParser/ChartRuleLookupManagerOnDisk.cpp @@ -238,15 +238,15 @@ void ChartRuleLookupManagerOnDisk::GetChartRuleCollection( continue; TargetPhraseCollection::shared_ptr targetPhraseCollection; - const OnDiskPt::PhraseNode *node - = prevNode.GetChild(*sourceLHSBerkeleyDb, m_dbWrapper); + const OnDiskPt::PhraseNode *node + = prevNode.GetChild(*sourceLHSBerkeleyDb, m_dbWrapper); if (node) { uint64_t tpCollFilePos = node->GetValue(); std::map::const_iterator iterCache = m_cache.find(tpCollFilePos); if (iterCache == m_cache.end()) { OnDiskPt::TargetPhraseCollection::shared_ptr tpcollBerkeleyDb - = node->GetTargetPhraseCollection(m_dictionary.GetTableLimit(), m_dbWrapper); + = node->GetTargetPhraseCollection(m_dictionary.GetTableLimit(), m_dbWrapper); std::vector weightT = staticData.GetWeights(&m_dictionary); targetPhraseCollection diff --git a/moses/TranslationModel/CompactPT/PhraseDictionaryCompact.cpp b/moses/TranslationModel/CompactPT/PhraseDictionaryCompact.cpp index ab14a02f7..880067ba4 100644 --- a/moses/TranslationModel/CompactPT/PhraseDictionaryCompact.cpp +++ b/moses/TranslationModel/CompactPT/PhraseDictionaryCompact.cpp @@ -107,7 +107,7 @@ void PhraseDictionaryCompact::Load() // } // }; -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryCompact::GetTargetPhraseCollectionNonCacheLEGACY(const Phrase &sourcePhrase) const { diff --git a/moses/TranslationModel/PhraseDictionary.cpp b/moses/TranslationModel/PhraseDictionary.cpp index b61e6f5eb..f27ae004e 100644 --- a/moses/TranslationModel/PhraseDictionary.cpp +++ b/moses/TranslationModel/PhraseDictionary.cpp @@ -61,7 +61,7 @@ ProvidesPrefixCheck() const return false; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionary:: GetTargetPhraseCollectionLEGACY(const Phrase& src) const { @@ -78,7 +78,7 @@ GetTargetPhraseCollectionLEGACY(const Phrase& src) const if (iter == cache.end()) { // not in cache, need to look up from phrase table ret = GetTargetPhraseCollectionNonCacheLEGACY(src); - if (ret) { // make a copy + if (ret) { // make a copy ret.reset(new TargetPhraseCollection(*ret)); } cache[hash] = entry(ret, clock()); @@ -95,7 +95,7 @@ GetTargetPhraseCollectionLEGACY(const Phrase& src) const return ret; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionary:: GetTargetPhraseCollectionNonCacheLEGACY(const Phrase& src) const { @@ -229,8 +229,8 @@ void PhraseDictionary::ReduceCache() const cache.erase(iterRemove); } else iter++; } - VERBOSE(2,"Reduced persistent translation option cache in " - << reduceCacheTime << " seconds." << std::endl); + VERBOSE(2,"Reduced persistent translation option cache in " + << reduceCacheTime << " seconds." << std::endl); } CacheColl &PhraseDictionary::GetCache() const diff --git a/moses/TranslationModel/PhraseDictionary.h b/moses/TranslationModel/PhraseDictionary.h index 605c8af7e..5798abb37 100644 --- a/moses/TranslationModel/PhraseDictionary.h +++ b/moses/TranslationModel/PhraseDictionary.h @@ -114,13 +114,12 @@ public: //! find list of translations that can translates src. Only for phrase input public: - virtual TargetPhraseCollection::shared_ptr + virtual TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionLEGACY(const Phrase& src) const; virtual TargetPhraseCollection::shared_ptr - GetTargetPhraseCollectionLEGACY(ttasksptr const& ttask, - Phrase const& src) const - { + GetTargetPhraseCollectionLEGACY(ttasksptr const& ttask, + Phrase const& src) const { return GetTargetPhraseCollectionLEGACY(src); } @@ -129,8 +128,7 @@ public: virtual void GetTargetPhraseCollectionBatch - (ttasksptr const& ttask, InputPathList const& inputPathQueue) const - { + (ttasksptr const& ttask, InputPathList const& inputPathQueue) const { GetTargetPhraseCollectionBatch(inputPathQueue); } @@ -159,7 +157,7 @@ public: // LEGACY //! find list of translations that can translates a portion of src. Used by confusion network decoding - virtual + virtual TargetPhraseCollectionWithSourcePhrase::shared_ptr GetTargetPhraseCollectionLEGACY(InputType const& src,WordsRange const& range) const; @@ -188,10 +186,10 @@ protected: mutable boost::scoped_ptr m_cache; #endif - virtual + virtual TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionNonCacheLEGACY(const Phrase& src) const; - + void ReduceCache() const; protected: diff --git a/moses/TranslationModel/PhraseDictionaryDynamicCacheBased.h b/moses/TranslationModel/PhraseDictionaryDynamicCacheBased.h index 4a9508be3..44488d719 100644 --- a/moses/TranslationModel/PhraseDictionaryDynamicCacheBased.h +++ b/moses/TranslationModel/PhraseDictionaryDynamicCacheBased.h @@ -111,7 +111,7 @@ public: void Load(); void Load(const std::string files); - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection(const Phrase &src) const; TargetPhraseCollection::shared_ptr diff --git a/moses/TranslationModel/PhraseDictionaryGroup.cpp b/moses/TranslationModel/PhraseDictionaryGroup.cpp index 92d62bfa4..b672d09e7 100644 --- a/moses/TranslationModel/PhraseDictionaryGroup.cpp +++ b/moses/TranslationModel/PhraseDictionaryGroup.cpp @@ -98,18 +98,18 @@ TargetPhraseCollection::shared_ptr PhraseDictionaryGroup::GetTargetPhraseCollec UTIL_THROW2("Don't call me without the translation task."); } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryGroup:: GetTargetPhraseCollectionLEGACY(const ttasksptr& ttask, const Phrase& src) const { - TargetPhraseCollection::shared_ptr ret - = CreateTargetPhraseCollection(ttask, src); + TargetPhraseCollection::shared_ptr ret + = CreateTargetPhraseCollection(ttask, src); ret->NthElement(m_tableLimit); // sort the phrases for pruning later const_cast(this)->CacheForCleanup(ret); return ret; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryGroup:: CreateTargetPhraseCollection(const ttasksptr& ttask, const Phrase& src) const { @@ -123,8 +123,8 @@ CreateTargetPhraseCollection(const ttasksptr& ttask, const Phrase& src) const // Collect phrases from this table const PhraseDictionary& pd = *m_memberPDs[i]; - TargetPhraseCollection::shared_ptr - ret_raw = pd.GetTargetPhraseCollectionLEGACY(ttask, src); + TargetPhraseCollection::shared_ptr + ret_raw = pd.GetTargetPhraseCollectionLEGACY(ttask, src); if (ret_raw != NULL) { // Process each phrase from table @@ -178,8 +178,8 @@ CreateTargetPhraseCollection(const ttasksptr& ttask, const Phrase& src) const ChartRuleLookupManager* PhraseDictionaryGroup:: -CreateRuleLookupManager(const ChartParser &, - const ChartCellCollectionBase&, size_t) +CreateRuleLookupManager(const ChartParser &, + const ChartCellCollectionBase&, size_t) { UTIL_THROW(util::Exception, "Phrase table used in chart decoder"); } @@ -191,7 +191,7 @@ void PhraseDictionaryGroup::CacheForCleanup(TargetPhraseCollection::shared_ptr ref.push_back(tpc); } -void +void PhraseDictionaryGroup:: CleanUpAfterSentenceProcessing(const InputType &source) { diff --git a/moses/TranslationModel/PhraseDictionaryGroup.h b/moses/TranslationModel/PhraseDictionaryGroup.h index 390e20def..f8deca41f 100644 --- a/moses/TranslationModel/PhraseDictionaryGroup.h +++ b/moses/TranslationModel/PhraseDictionaryGroup.h @@ -43,9 +43,9 @@ class PhraseDictionaryGroup: public PhraseDictionary public: PhraseDictionaryGroup(const std::string& line); void Load(); - TargetPhraseCollection::shared_ptr - CreateTargetPhraseCollection(const ttasksptr& ttask, - const Phrase& src) const; + TargetPhraseCollection::shared_ptr + CreateTargetPhraseCollection(const ttasksptr& ttask, + const Phrase& src) const; std::vector > getWeights(size_t numWeights, bool normalize) const; void CacheForCleanup(TargetPhraseCollection::shared_ptr tpc); diff --git a/moses/TranslationModel/PhraseDictionaryMemory.cpp b/moses/TranslationModel/PhraseDictionaryMemory.cpp index a7bd96d99..3053e46db 100644 --- a/moses/TranslationModel/PhraseDictionaryMemory.cpp +++ b/moses/TranslationModel/PhraseDictionaryMemory.cpp @@ -49,17 +49,17 @@ PhraseDictionaryMemory::PhraseDictionaryMemory(const std::string &line) } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryMemory:: GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) + const TargetPhrase &target, + const Word *sourceLHS) { PhraseDictionaryNodeMemory &currNode = GetOrCreateNode(source, target, sourceLHS); return currNode.GetTargetPhraseCollection(); } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryMemory:: GetTargetPhraseCollectionLEGACY(const Phrase& sourceOrig) const { @@ -74,7 +74,7 @@ GetTargetPhraseCollectionLEGACY(const Phrase& sourceOrig) const const Word& word = source.GetWord(pos); currNode = currNode->GetChild(word); if (currNode == NULL) - return TargetPhraseCollection::shared_ptr(); + return TargetPhraseCollection::shared_ptr(); } return currNode->GetTargetPhraseCollection(); @@ -171,8 +171,8 @@ GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const const PhraseDictionaryNodeMemory *ptNode = prevPtNode->GetChild(lastWord); TargetPhraseCollection::shared_ptr targetPhrases; if (ptNode) { - targetPhrases = ptNode->GetTargetPhraseCollection(); - } + targetPhrases = ptNode->GetTargetPhraseCollection(); + } inputPath.SetTargetPhrases(*this, targetPhrases, ptNode); } } diff --git a/moses/TranslationModel/PhraseDictionaryMemory.h b/moses/TranslationModel/PhraseDictionaryMemory.h index 1e32f2448..86bda5087 100644 --- a/moses/TranslationModel/PhraseDictionaryMemory.h +++ b/moses/TranslationModel/PhraseDictionaryMemory.h @@ -56,10 +56,10 @@ public: std::size_t); // only used by multi-model phrase table, and other meta-features - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionLEGACY(const Phrase& src) const; - void + void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const; TO_STRING(); @@ -70,9 +70,9 @@ protected: (const Phrase &source, const TargetPhrase &target, const Word *sourceLHS); PhraseDictionaryNodeMemory & - GetOrCreateNode(const Phrase &source, const TargetPhrase &target, - const Word *sourceLHS); - + GetOrCreateNode(const Phrase &source, const TargetPhrase &target, + const Word *sourceLHS); + void SortAndPrune(); PhraseDictionaryNodeMemory m_collection; diff --git a/moses/TranslationModel/PhraseDictionaryMultiModel.cpp b/moses/TranslationModel/PhraseDictionaryMultiModel.cpp index 7384020fb..e8ffa9d1d 100644 --- a/moses/TranslationModel/PhraseDictionaryMultiModel.cpp +++ b/moses/TranslationModel/PhraseDictionaryMultiModel.cpp @@ -59,7 +59,7 @@ PhraseDictionaryMultiModel(int type, const std::string &line) } } -void +void PhraseDictionaryMultiModel:: SetParameter(const std::string& key, const std::string& value) { @@ -93,7 +93,7 @@ void PhraseDictionaryMultiModel::Load() } } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryMultiModel:: GetTargetPhraseCollectionLEGACY(const Phrase& src) const { @@ -107,7 +107,7 @@ GetTargetPhraseCollectionLEGACY(const Phrase& src) const CollectSufficientStatistics(src, allStats); ret = CreateTargetPhraseCollectionLinearInterpolation(src, allStats, multimodelweights); RemoveAllInMap(*allStats); - delete allStats; // ??? Why the detour through malloc? UG + delete allStats; // ??? Why the detour through malloc? UG ret->NthElement(m_tableLimit); // sort the phrases for pruning later const_cast(this)->CacheForCleanup(ret); @@ -115,7 +115,7 @@ GetTargetPhraseCollectionLEGACY(const Phrase& src) const return ret; } -void +void PhraseDictionaryMultiModel:: CollectSufficientStatistics (const Phrase& src, std::map* allStats) const @@ -172,11 +172,11 @@ CollectSufficientStatistics } } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryMultiModel:: CreateTargetPhraseCollectionLinearInterpolation -( const Phrase& src, - std::map* allStats, +( const Phrase& src, + std::map* allStats, std::vector > &multimodelweights) const { TargetPhraseCollection::shared_ptr ret(new TargetPhraseCollection); @@ -204,7 +204,7 @@ CreateTargetPhraseCollectionLinearInterpolation } //TODO: is it worth caching the results as long as weights don't change? -std::vector > +std::vector > PhraseDictionaryMultiModel:: getWeights(size_t numWeights, bool normalize) const { @@ -255,7 +255,7 @@ getWeights(size_t numWeights, bool normalize) const return multimodelweights; } -std::vector +std::vector PhraseDictionaryMultiModel:: normalizeWeights(std::vector &weights) const { @@ -270,15 +270,15 @@ normalizeWeights(std::vector &weights) const ChartRuleLookupManager * PhraseDictionaryMultiModel:: -CreateRuleLookupManager(const ChartParser &, const ChartCellCollectionBase&, - std::size_t) +CreateRuleLookupManager(const ChartParser &, const ChartCellCollectionBase&, + std::size_t) { UTIL_THROW(util::Exception, "Phrase table used in chart decoder"); } //copied from PhraseDictionaryCompact; free memory allocated to TargetPhraseCollection (and each TargetPhrase) at end of sentence -void +void PhraseDictionaryMultiModel:: CacheForCleanup(TargetPhraseCollection::shared_ptr tpc) { @@ -286,7 +286,7 @@ CacheForCleanup(TargetPhraseCollection::shared_ptr tpc) } -void +void PhraseDictionaryMultiModel:: CleanUpAfterSentenceProcessing(const InputType &source) { @@ -306,7 +306,7 @@ CleanUpAfterSentenceProcessing(const InputType &source) } -void +void PhraseDictionaryMultiModel:: CleanUpComponentModels(const InputType &source) { @@ -315,7 +315,7 @@ CleanUpComponentModels(const InputType &source) } } -const std::vector* +const std::vector* PhraseDictionaryMultiModel:: GetTemporaryMultiModelWeightsVector() const { @@ -331,7 +331,7 @@ GetTemporaryMultiModelWeightsVector() const #endif } -void +void PhraseDictionaryMultiModel:: SetTemporaryMultiModelWeightsVector(std::vector weights) { @@ -344,7 +344,7 @@ SetTemporaryMultiModelWeightsVector(std::vector weights) } #ifdef WITH_DLIB -vector +vector PhraseDictionaryMultiModel:: MinimizePerplexity(vector > &phrase_pair_vector) { @@ -418,7 +418,7 @@ MinimizePerplexity(vector > &phrase_pair_vector) } -vector +vector PhraseDictionaryMultiModel:: Optimize(OptimizationObjective *ObjectiveFunction, size_t numModels) { diff --git a/moses/TranslationModel/PhraseDictionaryMultiModel.h b/moses/TranslationModel/PhraseDictionaryMultiModel.h index eb7467d3c..bdb399ddb 100644 --- a/moses/TranslationModel/PhraseDictionaryMultiModel.h +++ b/moses/TranslationModel/PhraseDictionaryMultiModel.h @@ -72,29 +72,29 @@ public: ~PhraseDictionaryMultiModel(); void Load(); - virtual void + virtual void CollectSufficientStatistics - (const Phrase& src, std::map* allStats) - const; + (const Phrase& src, std::map* allStats) + const; - virtual TargetPhraseCollection::shared_ptr + virtual TargetPhraseCollection::shared_ptr CreateTargetPhraseCollectionLinearInterpolation - (const Phrase& src, std::map* allStats, + (const Phrase& src, std::map* allStats, std::vector > &multimodelweights) const; - std::vector > + std::vector > getWeights(size_t numWeights, bool normalize) const; - std::vector + std::vector normalizeWeights(std::vector &weights) const; - void + void CacheForCleanup(TargetPhraseCollection::shared_ptr tpc); - void + void CleanUpAfterSentenceProcessing(const InputType &source); - virtual void + virtual void CleanUpComponentModels(const InputType &source); #ifdef WITH_DLIB @@ -103,26 +103,26 @@ public: #endif // functions below required by base class - virtual TargetPhraseCollection::shared_ptr + virtual TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionLEGACY(const Phrase& src) const; - virtual void + virtual void InitializeForInput(ttasksptr const& ttask) { // Don't do anything source specific here as this object is shared // between threads. } ChartRuleLookupManager* - CreateRuleLookupManager(const ChartParser &, const ChartCellCollectionBase&, - std::size_t); + CreateRuleLookupManager(const ChartParser &, const ChartCellCollectionBase&, + std::size_t); - void + void SetParameter(const std::string& key, const std::string& value); - const std::vector* + const std::vector* GetTemporaryMultiModelWeightsVector() const; - void + void SetTemporaryMultiModelWeightsVector(std::vector weights); protected: diff --git a/moses/TranslationModel/PhraseDictionaryMultiModelCounts.cpp b/moses/TranslationModel/PhraseDictionaryMultiModelCounts.cpp index 4c61f16db..bd2552d9d 100644 --- a/moses/TranslationModel/PhraseDictionaryMultiModelCounts.cpp +++ b/moses/TranslationModel/PhraseDictionaryMultiModelCounts.cpp @@ -134,8 +134,8 @@ TargetPhraseCollection::shared_ptr PhraseDictionaryMultiModelCounts::GetTargetPh CollectSufficientStats(src, fs, allStats); - TargetPhraseCollection::shared_ptr ret - = CreateTargetPhraseCollectionCounts(src, fs, allStats, multimodelweights); + TargetPhraseCollection::shared_ptr ret + = CreateTargetPhraseCollectionCounts(src, fs, allStats, multimodelweights); ret->NthElement(m_tableLimit); // sort the phrases for pruning later const_cast(this)->CacheForCleanup(ret); @@ -149,8 +149,8 @@ void PhraseDictionaryMultiModelCounts::CollectSufficientStats(const Phrase& src, for(size_t i = 0; i < m_numModels; ++i) { const PhraseDictionary &pd = *m_pd[i]; - TargetPhraseCollection::shared_ptr ret_raw - = pd.GetTargetPhraseCollectionLEGACY(src); + TargetPhraseCollection::shared_ptr ret_raw + = pd.GetTargetPhraseCollectionLEGACY(src); if (ret_raw != NULL) { TargetPhraseCollection::const_iterator iterTargetPhrase; @@ -202,7 +202,7 @@ void PhraseDictionaryMultiModelCounts::CollectSufficientStats(const Phrase& src, } } - TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryMultiModelCounts:: CreateTargetPhraseCollectionCounts(const Phrase &src, vector &fs, map* allStats, vector > &multimodelweights) const { diff --git a/moses/TranslationModel/PhraseDictionaryNodeMemory.h b/moses/TranslationModel/PhraseDictionaryNodeMemory.h index 29defe71f..8608b90a1 100644 --- a/moses/TranslationModel/PhraseDictionaryNodeMemory.h +++ b/moses/TranslationModel/PhraseDictionaryNodeMemory.h @@ -134,9 +134,9 @@ private: public: - PhraseDictionaryNodeMemory() + PhraseDictionaryNodeMemory() : m_targetPhraseCollection(new TargetPhraseCollection) { } - + bool IsLeaf() const { return m_sourceTermMap.empty() && m_nonTermMap.empty(); } @@ -153,11 +153,11 @@ public: const PhraseDictionaryNodeMemory *GetChild(const Word &sourceNonTerm, const Word &targetNonTerm) const; #endif - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() const { return m_targetPhraseCollection; } - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection() { return m_targetPhraseCollection; } diff --git a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp index 6a72b265f..13ca1d1d1 100644 --- a/moses/TranslationModel/PhraseDictionaryTransliteration.cpp +++ b/moses/TranslationModel/PhraseDictionaryTransliteration.cpp @@ -54,7 +54,7 @@ void PhraseDictionaryTransliteration::GetTargetPhraseCollectionBatch(const Input } } -void +void PhraseDictionaryTransliteration:: GetTargetPhraseCollection(InputPath &inputPath) const { @@ -92,8 +92,8 @@ GetTargetPhraseCollection(InputPath &inputPath) const UTIL_THROW_IF2(ret != 0, "Transliteration script error"); TargetPhraseCollection::shared_ptr tpColl(new TargetPhraseCollection); - vector targetPhrases - = CreateTargetPhrases(sourcePhrase, outDir.path()); + vector targetPhrases + = CreateTargetPhrases(sourcePhrase, outDir.path()); vector::const_iterator iter; for (iter = targetPhrases.begin(); iter != targetPhrases.end(); ++iter) { TargetPhrase *tp = *iter; diff --git a/moses/TranslationModel/PhraseDictionaryTreeAdaptor.h b/moses/TranslationModel/PhraseDictionaryTreeAdaptor.h index 564ceae16..020ce117e 100644 --- a/moses/TranslationModel/PhraseDictionaryTreeAdaptor.h +++ b/moses/TranslationModel/PhraseDictionaryTreeAdaptor.h @@ -59,7 +59,7 @@ public: // get translation candidates for a given source phrase // returns null pointer if nothing found - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionNonCacheLEGACY(Phrase const &src) const; void InitializeForInput(ttasksptr const& ttask); @@ -75,8 +75,8 @@ public: // legacy TargetPhraseCollectionWithSourcePhrase::shared_ptr - GetTargetPhraseCollectionLEGACY(InputType const& src, - WordsRange const & srcRange) const; + GetTargetPhraseCollectionLEGACY(InputType const& src, + WordsRange const & srcRange) const; }; diff --git a/moses/TranslationModel/RuleTable/Loader.h b/moses/TranslationModel/RuleTable/Loader.h index 66a08b0db..b3aed9dc0 100644 --- a/moses/TranslationModel/RuleTable/Loader.h +++ b/moses/TranslationModel/RuleTable/Loader.h @@ -49,14 +49,13 @@ protected: // Provide access to RuleTableTrie's private // GetOrCreateTargetPhraseCollection function. - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(RuleTableTrie &ruleTable, - const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) - { - return ruleTable.GetOrCreateTargetPhraseCollection(source, target, - sourceLHS); + const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) { + return ruleTable.GetOrCreateTargetPhraseCollection(source, target, + sourceLHS); } }; diff --git a/moses/TranslationModel/RuleTable/LoaderCompact.cpp b/moses/TranslationModel/RuleTable/LoaderCompact.cpp index cac698cf4..945a49bfc 100644 --- a/moses/TranslationModel/RuleTable/LoaderCompact.cpp +++ b/moses/TranslationModel/RuleTable/LoaderCompact.cpp @@ -225,8 +225,8 @@ bool RuleTableLoaderCompact::LoadRuleSection( // Insert rule into table. TargetPhraseCollection::shared_ptr coll; - coll = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, - *targetPhrase, &sourceLHS); + coll = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, + *targetPhrase, &sourceLHS); coll->Add(targetPhrase); } diff --git a/moses/TranslationModel/RuleTable/LoaderStandard.cpp b/moses/TranslationModel/RuleTable/LoaderStandard.cpp index 637cf28a3..2c2c3a8be 100644 --- a/moses/TranslationModel/RuleTable/LoaderStandard.cpp +++ b/moses/TranslationModel/RuleTable/LoaderStandard.cpp @@ -242,9 +242,9 @@ bool RuleTableLoaderStandard::Load(FormatType format targetPhrase->GetScoreBreakdown().Assign(&ruleTable, scoreVector); targetPhrase->EvaluateInIsolation(sourcePhrase, ruleTable.GetFeaturesToApply()); - TargetPhraseCollection::shared_ptr phraseColl - = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, - *targetPhrase, sourceLHS); + TargetPhraseCollection::shared_ptr phraseColl + = GetOrCreateTargetPhraseCollection(ruleTable, sourcePhrase, + *targetPhrase, sourceLHS); phraseColl->Add(targetPhrase); // not implemented correctly in memory pt. just delete it for now diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp index d2bd9c6cc..0d6321f2b 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.cpp @@ -282,9 +282,9 @@ void PhraseDictionaryFuzzyMatch::InitializeForInput(ttasksptr const& ttask) targetPhrase->GetScoreBreakdown().Assign(this, scoreVector); targetPhrase->EvaluateInIsolation(sourcePhrase, GetFeaturesToApply()); - TargetPhraseCollection::shared_ptr phraseColl - = GetOrCreateTargetPhraseCollection(rootNode, sourcePhrase, - *targetPhrase, sourceLHS); + TargetPhraseCollection::shared_ptr phraseColl + = GetOrCreateTargetPhraseCollection(rootNode, sourcePhrase, + *targetPhrase, sourceLHS); phraseColl->Add(targetPhrase); count++; @@ -303,12 +303,12 @@ void PhraseDictionaryFuzzyMatch::InitializeForInput(ttasksptr const& ttask) //removedirectoryrecursively(dirName); } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryFuzzyMatch:: GetOrCreateTargetPhraseCollection(PhraseDictionaryNodeMemory &rootNode - , const Phrase &source - , const TargetPhrase &target - , const Word *sourceLHS) + , const Phrase &source + , const TargetPhrase &target + , const Word *sourceLHS) { PhraseDictionaryNodeMemory &currNode = GetOrCreateNode(rootNode, source, target, sourceLHS); return currNode.GetTargetPhraseCollection(); diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.h b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.h index c57061704..5c710021a 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.h +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryFuzzyMatch.h @@ -60,11 +60,11 @@ public: TO_STRING(); protected: - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(PhraseDictionaryNodeMemory &rootNode - , const Phrase &source - , const TargetPhrase &target - , const Word *sourceLHS); + , const Phrase &source + , const TargetPhrase &target + , const Word *sourceLHS); PhraseDictionaryNodeMemory &GetOrCreateNode(PhraseDictionaryNodeMemory &rootNode , const Phrase &source diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp index c68cd5d62..3eba6e5de 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.cpp @@ -158,13 +158,13 @@ void PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(InputPath &inputPath ptNode = prevPtNode->GetChild(*lastWordOnDisk, wrapper); if (ptNode) tpc = GetTargetPhraseCollection(ptNode); inputPath.SetTargetPhrases(*this, tpc, ptNode); - + delete lastWordOnDisk; } } } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryOnDisk:: GetTargetPhraseCollection(const OnDiskPt::PhraseNode *ptNode) const { @@ -192,21 +192,21 @@ GetTargetPhraseCollection(const OnDiskPt::PhraseNode *ptNode) const return ret; } -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr PhraseDictionaryOnDisk:: GetTargetPhraseCollectionNonCache(const OnDiskPt::PhraseNode *ptNode) const { - OnDiskPt::OnDiskWrapper& wrapper - = const_cast(GetImplementation()); + OnDiskPt::OnDiskWrapper& wrapper + = const_cast(GetImplementation()); vector weightT = StaticData::Instance().GetWeights(this); OnDiskPt::Vocab &vocab = wrapper.GetVocab(); - OnDiskPt::TargetPhraseCollection::shared_ptr targetPhrasesOnDisk - = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper); + OnDiskPt::TargetPhraseCollection::shared_ptr targetPhrasesOnDisk + = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper); TargetPhraseCollection::shared_ptr targetPhrases - = targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, - weightT, vocab, false); + = targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, + weightT, vocab, false); // delete targetPhrasesOnDisk; diff --git a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h index 2d6befccf..c3449e972 100644 --- a/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h +++ b/moses/TranslationModel/RuleTable/PhraseDictionaryOnDisk.h @@ -78,10 +78,10 @@ public: virtual void InitializeForInput(ttasksptr const& ttask); void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollection(const OnDiskPt::PhraseNode *ptNode) const; - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionNonCache(const OnDiskPt::PhraseNode *ptNode) const; void SetParameter(const std::string& key, const std::string& value); diff --git a/moses/TranslationModel/RuleTable/Trie.h b/moses/TranslationModel/RuleTable/Trie.h index 49ae35a4e..76cbc16e5 100644 --- a/moses/TranslationModel/RuleTable/Trie.h +++ b/moses/TranslationModel/RuleTable/Trie.h @@ -51,10 +51,10 @@ public: private: friend class RuleTableLoader; - virtual TargetPhraseCollection::shared_ptr - GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) = 0; + virtual TargetPhraseCollection::shared_ptr + GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) = 0; virtual void SortAndPrune() = 0; diff --git a/moses/TranslationModel/RuleTable/UTrie.cpp b/moses/TranslationModel/RuleTable/UTrie.cpp index 667ff2822..eee88a11b 100644 --- a/moses/TranslationModel/RuleTable/UTrie.cpp +++ b/moses/TranslationModel/RuleTable/UTrie.cpp @@ -38,11 +38,11 @@ namespace Moses { -TargetPhraseCollection::shared_ptr +TargetPhraseCollection::shared_ptr RuleTableUTrie:: -GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS) +GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS) { UTrieNode &currNode = GetOrCreateNode(source, target, sourceLHS); return currNode.GetOrCreateTargetPhraseCollection(target); diff --git a/moses/TranslationModel/RuleTable/UTrie.h b/moses/TranslationModel/RuleTable/UTrie.h index 6e9fc08ef..708bf866e 100644 --- a/moses/TranslationModel/RuleTable/UTrie.h +++ b/moses/TranslationModel/RuleTable/UTrie.h @@ -57,10 +57,10 @@ public: const ChartCellCollectionBase &, std::size_t); private: - TargetPhraseCollection::shared_ptr - GetOrCreateTargetPhraseCollection(const Phrase &source, - const TargetPhrase &target, - const Word *sourceLHS); + TargetPhraseCollection::shared_ptr + GetOrCreateTargetPhraseCollection(const Phrase &source, + const TargetPhrase &target, + const Word *sourceLHS); UTrieNode &GetOrCreateNode(const Phrase &source, const TargetPhrase &target, const Word *sourceLHS); diff --git a/moses/TranslationModel/RuleTable/UTrieNode.h b/moses/TranslationModel/RuleTable/UTrieNode.h index 9438f9bfd..96ba09e85 100644 --- a/moses/TranslationModel/RuleTable/UTrieNode.h +++ b/moses/TranslationModel/RuleTable/UTrieNode.h @@ -51,7 +51,7 @@ public: TerminalEqualityPred> TerminalMap; typedef boost::unordered_map, - TargetPhraseCollection::shared_ptr> LabelMap; + TargetPhraseCollection::shared_ptr> LabelMap; #else typedef std::map TerminalMap; typedef std::map, TargetPhraseCollection::shared_ptr> LabelMap; @@ -78,7 +78,7 @@ public: UTrieNode *GetOrCreateTerminalChild(const Word &sourceTerm); UTrieNode *GetOrCreateNonTerminalChild(const Word &targetNonTerm); - TargetPhraseCollection::shared_ptr + TargetPhraseCollection::shared_ptr GetOrCreateTargetPhraseCollection(const TargetPhrase &); bool IsLeaf() const { diff --git a/moses/TranslationModel/Scope3Parser/Parser.cpp b/moses/TranslationModel/Scope3Parser/Parser.cpp index c306fc35a..fe1561c6e 100644 --- a/moses/TranslationModel/Scope3Parser/Parser.cpp +++ b/moses/TranslationModel/Scope3Parser/Parser.cpp @@ -47,8 +47,8 @@ void Scope3Parser::GetChartRuleCollection( const size_t start = range.GetStartPos(); const size_t end = range.GetEndPos(); - std::vector > &pairVec - = m_ruleApplications[start][end-start+1]; + std::vector > &pairVec + = m_ruleApplications[start][end-start+1]; MatchCallback matchCB(range, outColl); for (std::vector >::const_iterator p = pairVec.begin(); p != pairVec.end(); ++p) { @@ -71,7 +71,7 @@ void Scope3Parser::GetChartRuleCollection( UTrieNode::LabelMap::const_iterator p = labelMap.begin(); for (; p != labelMap.end(); ++p) { const std::vector &labels = p->first; - TargetPhraseCollection::shared_ptr tpc = p->second; + TargetPhraseCollection::shared_ptr tpc = p->second; assert(labels.size() == varSpanNode.m_rank); bool failCheck = false; for (size_t i = 0; i < varSpanNode.m_rank; ++i) { diff --git a/moses/TranslationModel/Scope3Parser/Parser.h b/moses/TranslationModel/Scope3Parser/Parser.h index 6091697fb..e7f4a5d51 100644 --- a/moses/TranslationModel/Scope3Parser/Parser.h +++ b/moses/TranslationModel/Scope3Parser/Parser.h @@ -67,7 +67,7 @@ private: struct MatchCallback { public: MatchCallback(const WordsRange &range, ChartParserCallback &out) - : m_range(range) , m_out(out) // , m_tpc(NULL) + : m_range(range) , m_out(out) // , m_tpc(NULL) { } void operator()(const StackVec &stackVec) { diff --git a/moses/TranslationModel/SkeletonPT.cpp b/moses/TranslationModel/SkeletonPT.cpp index a581ca0d8..1b8e0cfa1 100644 --- a/moses/TranslationModel/SkeletonPT.cpp +++ b/moses/TranslationModel/SkeletonPT.cpp @@ -37,8 +37,8 @@ void SkeletonPT::GetTargetPhraseCollectionBatch(const InputPathList &inputPathQu // add target phrase to phrase-table cache size_t hash = hash_value(sourcePhrase); - std::pair - value(tpColl, clock()); + std::pair + value(tpColl, clock()); cache[hash] = value; inputPath.SetTargetPhrases(*this, tpColl, NULL); diff --git a/moses/TranslationOptionCollectionLattice.cpp b/moses/TranslationOptionCollectionLattice.cpp index bf5c305d2..2cb3b6387 100644 --- a/moses/TranslationOptionCollectionLattice.cpp +++ b/moses/TranslationOptionCollectionLattice.cpp @@ -61,8 +61,8 @@ TranslationOptionCollectionLattice const ScorePair &scores = col[i].second; ScorePair *inputScore = new ScorePair(scores); - InputPath *path - = new InputPath(ttask, subphrase, labels, range, NULL, inputScore); + InputPath *path + = new InputPath(ttask, subphrase, labels, range, NULL, inputScore); path->SetNextNode(nextNode); m_inputPathQueue.push_back(path); @@ -114,8 +114,8 @@ void TranslationOptionCollectionLattice::Extend(const InputPath &prevPath, const ScorePair *inputScore = new ScorePair(*prevInputScore); inputScore->PlusEquals(scores); - InputPath *path = new InputPath(prevPath.ttask, subphrase, labels, - range, &prevPath, inputScore); + InputPath *path = new InputPath(prevPath.ttask, subphrase, labels, + range, &prevPath, inputScore); path->SetNextNode(nextNode); m_inputPathQueue.push_back(path); @@ -142,8 +142,8 @@ void TranslationOptionCollectionLattice::CreateTranslationOptions() for (size_t i = 0; i < m_inputPathQueue.size(); ++i) { const InputPath &path = *m_inputPathQueue[i]; - TargetPhraseCollection::shared_ptr tpColl - = path.GetTargetPhrases(phraseDictionary); + TargetPhraseCollection::shared_ptr tpColl + = path.GetTargetPhrases(phraseDictionary); const WordsRange &range = path.GetWordsRange(); if (tpColl && tpColl->GetSize()) { diff --git a/moses/Util.h b/moses/Util.h index cc0f7314b..c30ae5018 100644 --- a/moses/Util.h +++ b/moses/Util.h @@ -428,7 +428,7 @@ inline float CalcTranslationScore(const std::vector &probVector, out << *this; \ return out.str(); \ } \ - + //! delete and remove every element of a collection object such as set, list etc template void RemoveAllInColl(COLL &coll)