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:
authorPhil Williams <philip.williams@mac.com>2014-03-14 12:49:09 +0400
committerPhil Williams <philip.williams@mac.com>2014-03-14 12:49:09 +0400
commit04dbd3c7aa173fed788b32d7967d6af521e72b20 (patch)
treee898df3fe15e566a5a9a19d593fb07277bf97b65 /moses/ChartParser.cpp
parent0e308e41ca4e21d5f370d3458912a56377e0d2cf (diff)
moses_chart: more efficient scope-3 parsing if sentence length < max-chart-span
Diffstat (limited to 'moses/ChartParser.cpp')
-rw-r--r--moses/ChartParser.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/moses/ChartParser.cpp b/moses/ChartParser.cpp
index deccf74e4..6a9ec2efb 100644
--- a/moses/ChartParser.cpp
+++ b/moses/ChartParser.cpp
@@ -141,15 +141,13 @@ ChartParser::ChartParser(InputType const &source, ChartCellCollectionBase &cells
CreateInputPaths(m_source);
const std::vector<PhraseDictionary*> &dictionaries = PhraseDictionary::GetColl();
+ assert(dictionaries.size() == m_decodeGraphList.size());
m_ruleLookupManagers.reserve(dictionaries.size());
- for (std::vector<PhraseDictionary*>::const_iterator p = dictionaries.begin();
- p != dictionaries.end(); ++p) {
-
- const PhraseDictionary *dict = *p;
+ for (std::size_t i = 0; i < dictionaries.size(); ++i) {
+ const PhraseDictionary *dict = dictionaries[i];
PhraseDictionary *nonConstDict = const_cast<PhraseDictionary*>(dict);
-
- ChartRuleLookupManager *lookupMgr = nonConstDict->CreateRuleLookupManager(*this, cells);
-
+ std::size_t maxChartSpan = m_decodeGraphList[i]->GetMaxChartSpan();
+ ChartRuleLookupManager *lookupMgr = nonConstDict->CreateRuleLookupManager(*this, cells, maxChartSpan);
m_ruleLookupManagers.push_back(lookupMgr);
}