mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 12:52:29 +03:00
finished converting TargetPhraseCollection* to TargetPhraseCollection
This commit is contained in:
parent
e1a86bd9c9
commit
f3e0fd2dd4
@ -154,12 +154,10 @@ void ChartRuleLookupManagerMemory::GetChartRuleCollection(
|
||||
const PhraseDictionaryNodeMemory &node = dottedRule.GetLastNode();
|
||||
|
||||
// look up target sides
|
||||
const TargetPhraseCollection *tpc = node.GetTargetPhraseCollection();
|
||||
const TargetPhraseCollection &tpc = node.GetTargetPhraseCollection();
|
||||
|
||||
// add the fully expanded rule (with lexical target side)
|
||||
if (tpc != NULL) {
|
||||
AddCompletedRule(dottedRule, *tpc, range, outColl);
|
||||
}
|
||||
AddCompletedRule(dottedRule, tpc, range, outColl);
|
||||
}
|
||||
|
||||
dottedRuleCol.Clear(relEndPos+1);
|
||||
|
@ -153,12 +153,10 @@ void ChartRuleLookupManagerMemoryPerSentence::GetChartRuleCollection(
|
||||
const PhraseDictionaryNodeMemory &node = dottedRule.GetLastNode();
|
||||
|
||||
// look up target sides
|
||||
const TargetPhraseCollection *tpc = node.GetTargetPhraseCollection();
|
||||
const TargetPhraseCollection &tpc = node.GetTargetPhraseCollection();
|
||||
|
||||
// add the fully expanded rule (with lexical target side)
|
||||
if (tpc != NULL) {
|
||||
AddCompletedRule(dottedRule, *tpc, range, outColl);
|
||||
}
|
||||
AddCompletedRule(dottedRule, tpc, range, outColl);
|
||||
}
|
||||
|
||||
dottedRuleCol.Clear(relEndPos+1);
|
||||
|
@ -51,7 +51,7 @@ TargetPhraseCollection &PhraseDictionaryMemory::GetOrCreateTargetPhraseCollectio
|
||||
, const Word *sourceLHS)
|
||||
{
|
||||
PhraseDictionaryNodeMemory &currNode = GetOrCreateNode(source, target, sourceLHS);
|
||||
return currNode.GetOrCreateTargetPhraseCollection();
|
||||
return currNode.GetTargetPhraseCollection();
|
||||
}
|
||||
|
||||
const TargetPhraseCollection *PhraseDictionaryMemory::GetTargetPhraseCollection(const Phrase& sourceOrig) const
|
||||
@ -70,7 +70,7 @@ const TargetPhraseCollection *PhraseDictionaryMemory::GetTargetPhraseCollection(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return currNode->GetTargetPhraseCollection();
|
||||
return &currNode->GetTargetPhraseCollection();
|
||||
}
|
||||
|
||||
PhraseDictionaryNodeMemory &PhraseDictionaryMemory::GetOrCreateNode(const Phrase &source
|
||||
|
@ -133,10 +133,10 @@ public:
|
||||
const PhraseDictionaryNodeMemory *GetChild(const Word &sourceTerm) const;
|
||||
const PhraseDictionaryNodeMemory *GetChild(const Word &sourceNonTerm, const Word &targetNonTerm) const;
|
||||
|
||||
const TargetPhraseCollection *GetTargetPhraseCollection() const {
|
||||
return &m_targetPhraseCollection;
|
||||
const TargetPhraseCollection &GetTargetPhraseCollection() const {
|
||||
return m_targetPhraseCollection;
|
||||
}
|
||||
TargetPhraseCollection &GetOrCreateTargetPhraseCollection() {
|
||||
TargetPhraseCollection &GetTargetPhraseCollection() {
|
||||
return m_targetPhraseCollection;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ TargetPhraseCollection &PhraseDictionaryFuzzyMatch::GetOrCreateTargetPhraseColle
|
||||
, const Word *sourceLHS)
|
||||
{
|
||||
PhraseDictionaryNodeMemory &currNode = GetOrCreateNode(rootNode, source, target, sourceLHS);
|
||||
return currNode.GetOrCreateTargetPhraseCollection();
|
||||
return currNode.GetTargetPhraseCollection();
|
||||
}
|
||||
|
||||
PhraseDictionaryNodeMemory &PhraseDictionaryFuzzyMatch::GetOrCreateNode(PhraseDictionaryNodeMemory &rootNode
|
||||
|
Loading…
Reference in New Issue
Block a user