mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-09 04:56:57 +03:00
tighten up pt framework
This commit is contained in:
parent
f32996975a
commit
30036c56bb
@ -55,23 +55,23 @@ void PhraseTable::SetParameter(const std::string& key, const std::string& value)
|
||||
void PhraseTable::Lookup(const Manager &mgr, InputPathsBase &inputPaths) const
|
||||
{
|
||||
BOOST_FOREACH(InputPathBase *pathBase, inputPaths){
|
||||
InputPath *path = static_cast<InputPath*>(pathBase);
|
||||
InputPath *path = static_cast<InputPath*>(pathBase);
|
||||
|
||||
const SubPhrase &phrase = path->subPhrase;
|
||||
const SubPhrase &phrase = path->subPhrase;
|
||||
|
||||
TargetPhrases *tpsPtr = tpsPtr = Lookup(mgr, mgr.GetPool(), *path);
|
||||
TargetPhrases *tpsPtr = tpsPtr = Lookup(mgr, mgr.GetPool(), *path);
|
||||
|
||||
/*
|
||||
cerr << "path=" << path.GetRange() << " ";
|
||||
cerr << "tps=" << tps << " ";
|
||||
if (tps.get()) {
|
||||
cerr << tps.get()->GetSize();
|
||||
}
|
||||
cerr << endl;
|
||||
*/
|
||||
/*
|
||||
cerr << "path=" << path.GetRange() << " ";
|
||||
cerr << "tps=" << tps << " ";
|
||||
if (tps.get()) {
|
||||
cerr << tps.get()->GetSize();
|
||||
}
|
||||
cerr << endl;
|
||||
*/
|
||||
|
||||
path->AddTargetPhrases(*this, tpsPtr);
|
||||
}
|
||||
path->AddTargetPhrases(*this, tpsPtr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -97,13 +97,6 @@ void PhraseTable::InitActiveChart(SCFG::InputPath &path) const
|
||||
UTIL_THROW2("Not implemented");
|
||||
}
|
||||
|
||||
void PhraseTable::Lookup(MemPool &pool,
|
||||
const System &system,
|
||||
const SCFG::Stacks &stacks,
|
||||
SCFG::InputPath &path) const
|
||||
{
|
||||
UTIL_THROW2("Not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
virtual void Lookup(MemPool &pool,
|
||||
const System &system,
|
||||
const SCFG::Stacks &stacks,
|
||||
SCFG::InputPath &path) const;
|
||||
SCFG::InputPath &path) const = 0;
|
||||
|
||||
protected:
|
||||
std::string m_path;
|
||||
|
@ -314,5 +314,13 @@ void ProbingPT::CreateCache(System &system)
|
||||
|
||||
}
|
||||
|
||||
void ProbingPT::Lookup(MemPool &pool,
|
||||
const System &system,
|
||||
const SCFG::Stacks &stacks,
|
||||
SCFG::InputPath &path) const
|
||||
{
|
||||
UTIL_THROW2("Not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,11 @@ public:
|
||||
|
||||
void Lookup(const Manager &mgr, InputPathsBase &inputPaths) const;
|
||||
|
||||
virtual void Lookup(MemPool &pool,
|
||||
const System &system,
|
||||
const SCFG::Stacks &stacks,
|
||||
SCFG::InputPath &path) const;
|
||||
|
||||
protected:
|
||||
std::vector<uint64_t> m_sourceVocab; // factor id -> pt id
|
||||
std::vector<const Factor*> m_targetVocab; // pt id -> factor*
|
||||
|
Loading…
Reference in New Issue
Block a user