Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2020-10-05 19:08:16 +0300
committerHieu Hoang <hieuhoang@gmail.com>2020-10-05 19:08:16 +0300
commit6e78aae34fc58b7e98d463ac56d8485f66e0ec77 (patch)
tree4afa38e751adad9192c674891037d080ff38e687
parenta34623140a2d9a2793ab91337d8f3883382c2b20 (diff)
abort SCFG
-rw-r--r--moses2/TranslationModel/MSPT/MSPT.cpp80
1 files changed, 3 insertions, 77 deletions
diff --git a/moses2/TranslationModel/MSPT/MSPT.cpp b/moses2/TranslationModel/MSPT/MSPT.cpp
index 90feb3489..ab16c3255 100644
--- a/moses2/TranslationModel/MSPT/MSPT.cpp
+++ b/moses2/TranslationModel/MSPT/MSPT.cpp
@@ -181,10 +181,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,
@@ -193,38 +190,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(
@@ -236,47 +202,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();
}
}