diff options
author | Anoop Kunchukuttan <anoop.kunchukuttan@gmail.com> | 2020-10-05 20:09:06 +0300 |
---|---|---|
committer | Anoop Kunchukuttan <anoop.kunchukuttan@gmail.com> | 2020-10-05 20:09:06 +0300 |
commit | b8ae6d58afbd17a4e9b11d3c3f6fc8307d3f16d6 (patch) | |
tree | 2df3103c8f60489daea7e53369289d8967cca249 | |
parent | 0b0d5e84926983330d57120987a480e96867b943 (diff) | |
parent | 6e78aae34fc58b7e98d463ac56d8485f66e0ec77 (diff) |
Merge branch 'master' of vs-ssh.visualstudio.com:v3/machinetranslation/moses-mstranslator/moses-mstranslator
-rw-r--r-- | moses2/TranslationModel/MSPT/MSPT.cpp | 80 |
1 files changed, 3 insertions, 77 deletions
diff --git a/moses2/TranslationModel/MSPT/MSPT.cpp b/moses2/TranslationModel/MSPT/MSPT.cpp index 665d6dbea..d72d0b395 100644 --- a/moses2/TranslationModel/MSPT/MSPT.cpp +++ b/moses2/TranslationModel/MSPT/MSPT.cpp @@ -187,10 +187,7 @@ void MSPT::InitActiveChart( const SCFG::Manager &mgr, SCFG::InputPath &path) const { - size_t ptInd = GetPtInd(); - ActiveChartEntryMem *chartEntry = new (pool.Allocate<ActiveChartEntryMem>()) ActiveChartEntryMem(pool, *m_rootSCFG); - path.AddActiveChartEntry(ptInd, chartEntry); - //cerr << "InitActiveChart=" << path << endl; + abort(); } void MSPT::Lookup(MemPool &pool, @@ -199,38 +196,7 @@ void MSPT::Lookup(MemPool &pool, const SCFG::Stacks &stacks, SCFG::InputPath &path) const { - if (path.range.GetNumWordsCovered() > maxChartSpan) { - return; - } - - size_t endPos = path.range.GetEndPos(); - - const SCFG::InputPath *prevPath = static_cast<const SCFG::InputPath*>(path.prefixPath); - UTIL_THROW_IF2(prevPath == NULL, "prefixPath == NULL"); - - // TERMINAL - const SCFG::Word &lastWord = path.subPhrase.Back(); - - const SCFG::InputPath &subPhrasePath = *mgr.GetInputPaths().GetMatrix().GetValue(endPos, 1); - - //cerr << "BEFORE LookupGivenWord=" << *prevPath << endl; - LookupGivenWord(pool, mgr, *prevPath, lastWord, NULL, subPhrasePath.range, path); - //cerr << "AFTER LookupGivenWord=" << *prevPath << endl; - - // NON-TERMINAL - //const SCFG::InputPath *prefixPath = static_cast<const SCFG::InputPath*>(path.prefixPath); - while (prevPath) { - const Range &prevRange = prevPath->range; - //cerr << "prevRange=" << prevRange << endl; - - size_t startPos = prevRange.GetEndPos() + 1; - size_t ntSize = endPos - startPos + 1; - const SCFG::InputPath &subPhrasePath = *mgr.GetInputPaths().GetMatrix().GetValue(startPos, ntSize); - - LookupNT(pool, mgr, subPhrasePath.range, *prevPath, stacks, path); - - prevPath = static_cast<const SCFG::InputPath*>(prevPath->prefixPath); - } + abort(); } void MSPT::LookupGivenNode( @@ -242,47 +208,7 @@ void MSPT::LookupGivenNode( const Moses2::Range &subPhraseRange, SCFG::InputPath &outPath) const { - const ActiveChartEntryMem &prevEntryCast = static_cast<const ActiveChartEntryMem&>(prevEntry); - - const SCFGNODE &prevNode = prevEntryCast.node; - UTIL_THROW_IF2(&prevNode == NULL, "node == NULL"); - - size_t ptInd = GetPtInd(); - const SCFGNODE *nextNode = prevNode.Find(m_input, wordSought); - - /* - if (outPath.range.GetStartPos() == 1 || outPath.range.GetStartPos() == 2) { - cerr << "range=" << outPath.range - << " prevEntry=" << prevEntry.GetSymbolBind().Debug(mgr.system) - << " wordSought=" << wordSought.Debug(mgr.system) - << " nextNode=" << nextNode - << endl; - } - */ - if (nextNode) { - // new entries - ActiveChartEntryMem *chartEntry = new (pool.Allocate<ActiveChartEntryMem>()) ActiveChartEntryMem(pool, *nextNode, prevEntry); - - chartEntry->AddSymbolBindElement(subPhraseRange, wordSought, hypos, *this); - //cerr << "AFTER Add=" << symbolBind << endl; - - outPath.AddActiveChartEntry(ptInd, chartEntry); - - const SCFG::TargetPhrases *tps = nextNode->GetTargetPhrases(); - if (tps) { - // there are some rules - /* - cerr << "outPath=" << outPath.range - << " bind=" << chartEntry->GetSymbolBind().Debug(mgr.system) - << " pt=" << GetPtInd() - << " tps=" << tps->Debug(mgr.system) << endl; - */ - outPath.AddTargetPhrasesToPath(pool, mgr.system, *this, *tps, chartEntry->GetSymbolBind()); - - } - - //cerr << "AFTER outPath=" << outPath << endl; - } + abort(); } } |