mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 21:03:22 +03:00
Merge github.com:moses-smt/mosesdecoder into hieu_opt_input
This commit is contained in:
commit
5cbfcacccc
@ -1 +1 @@
|
||||
Subproject commit 1315185203a90b6f80acf2e47b4ea85b420b0d4c
|
||||
Subproject commit b4334b8f276d401c38b1163c4c33ad6b840e28be
|
@ -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);
|
||||
|
@ -52,7 +52,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
|
||||
@ -71,7 +71,7 @@ const TargetPhraseCollection *PhraseDictionaryMemory::GetTargetPhraseCollection(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return currNode->GetTargetPhraseCollection();
|
||||
return &currNode->GetTargetPhraseCollection();
|
||||
}
|
||||
|
||||
PhraseDictionaryNodeMemory &PhraseDictionaryMemory::GetOrCreateNode(const Phrase &source
|
||||
|
@ -223,7 +223,6 @@ void PhraseDictionaryMultiModelCounts::Load()
|
||||
|
||||
const TargetPhraseCollection *PhraseDictionaryMultiModelCounts::GetTargetPhraseCollection(const Phrase& src) const
|
||||
{
|
||||
|
||||
vector<vector<float> > multimodelweights;
|
||||
bool normalize;
|
||||
normalize = (m_mode == "interpolate") ? true : false;
|
||||
@ -346,11 +345,11 @@ float PhraseDictionaryMultiModelCounts::GetTargetCount(const Phrase &target, siz
|
||||
{
|
||||
|
||||
const PhraseDictionary &pd = *m_inverse_pd[modelIndex];
|
||||
TargetPhraseCollection *ret_raw = (TargetPhraseCollection*) pd.GetTargetPhraseCollection(target);
|
||||
const TargetPhraseCollection *ret_raw = pd.GetTargetPhraseCollection(target);
|
||||
|
||||
// in inverse mode, we want the first score of the first phrase pair (note: if we were to work with truly symmetric models, it would be the third score)
|
||||
if (ret_raw != NULL) {
|
||||
TargetPhrase * targetPhrase = *(ret_raw->begin());
|
||||
if (ret_raw && ret_raw->GetSize() > 0) {
|
||||
const TargetPhrase * targetPhrase = *(ret_raw->begin());
|
||||
return UntransformScore(targetPhrase->GetScoreBreakdown().GetScoresForProducer(&pd)[0]);
|
||||
}
|
||||
|
||||
|
@ -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