mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
Fix -search-algorithm 8
This commit is contained in:
parent
372d14a9e8
commit
0bff50449e
@ -45,6 +45,8 @@ Manager<RuleMatcher>::Manager(const InputType &source)
|
||||
boost::shared_ptr<Forest> forest = boost::make_shared<Forest>();
|
||||
m_rootVertex = T2S::InputTreeToForest(tmpTree, *forest);
|
||||
m_forest = forest;
|
||||
} else {
|
||||
UTIL_THROW2("ERROR: F2S::Manager requires input to be a tree or forest");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,10 +27,16 @@ namespace T2S
|
||||
{
|
||||
|
||||
template<typename RuleMatcher>
|
||||
Manager<RuleMatcher>::Manager(const TreeInput &source)
|
||||
Manager<RuleMatcher>::Manager(const InputType &source)
|
||||
: Syntax::Manager(source)
|
||||
, m_treeSource(source)
|
||||
{
|
||||
if (const TreeInput *p = dynamic_cast<const TreeInput*>(&source)) {
|
||||
// Construct the InputTree.
|
||||
InputTreeBuilder builder;
|
||||
builder.Build(*p, "Q", m_inputTree);
|
||||
} else {
|
||||
UTIL_THROW2("ERROR: T2S::Manager requires input to be a tree");
|
||||
}
|
||||
}
|
||||
|
||||
template<typename RuleMatcher>
|
||||
@ -94,10 +100,6 @@ void Manager<RuleMatcher>::Decode()
|
||||
const std::size_t ruleLimit = staticData.GetRuleLimit();
|
||||
const std::size_t stackLimit = staticData.GetMaxHypoStackSize();
|
||||
|
||||
// Construct the InputTree.
|
||||
InputTreeBuilder builder;
|
||||
builder.Build(m_treeSource, "Q", m_inputTree);
|
||||
|
||||
// Initialize the stacks.
|
||||
InitializeStacks();
|
||||
|
||||
|
@ -30,7 +30,7 @@ template<typename RuleMatcher>
|
||||
class Manager : public Syntax::Manager
|
||||
{
|
||||
public:
|
||||
Manager(const TreeInput &);
|
||||
Manager(const InputType &);
|
||||
|
||||
void Decode();
|
||||
|
||||
@ -51,7 +51,6 @@ private:
|
||||
|
||||
void RecombineAndSort(const std::vector<SHyperedge*> &, SVertexStack &);
|
||||
|
||||
const TreeInput &m_treeSource;
|
||||
InputTree m_inputTree;
|
||||
F2S::PVertexToStackMap m_stackMap;
|
||||
boost::shared_ptr<RuleTrie> m_glueRuleTrie;
|
||||
|
@ -88,8 +88,7 @@ void TranslationTask::Run()
|
||||
// SCFG-based tree-to-string decoding (ask Phil Williams)
|
||||
typedef Syntax::F2S::RuleMatcherCallback Callback;
|
||||
typedef Syntax::T2S::RuleMatcherSCFG<Callback> RuleMatcher;
|
||||
const TreeInput *tree = NULL;
|
||||
manager = new Syntax::T2S::Manager<RuleMatcher>(*tree);
|
||||
manager = new Syntax::T2S::Manager<RuleMatcher>(*m_source);
|
||||
} else if (staticData.GetSearchAlgorithm() == ChartIncremental) {
|
||||
// Ken's incremental decoding
|
||||
manager = new Incremental::Manager(*m_source);
|
||||
|
Loading…
Reference in New Issue
Block a user