mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 04:43:03 +03:00
placeholder for chart decoding
This commit is contained in:
parent
574d716f23
commit
00b21b4f53
@ -117,7 +117,7 @@ public:
|
||||
// shorthand for "global data"
|
||||
const StaticData &staticData = StaticData::Instance();
|
||||
// input sentence
|
||||
Sentence sentence();
|
||||
Sentence sentence;
|
||||
|
||||
// execute the translation
|
||||
// note: this executes the search, resulting in a search graph
|
||||
|
@ -68,6 +68,19 @@ std::set<size_t> AlignmentInfo::GetAlignmentsForSource(size_t sourcePos) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::set<size_t> AlignmentInfo::GetAlignmentsForTarget(size_t targetPos) const
|
||||
{
|
||||
std::set<size_t> ret;
|
||||
CollType::const_iterator iter;
|
||||
for (iter = begin(); iter != end(); ++iter) {
|
||||
const std::pair<size_t,size_t> &align = *iter;
|
||||
if (iter->second == targetPos) {
|
||||
ret.insert(iter->first);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool compare_target(const std::pair<size_t,size_t> *a, const std::pair<size_t,size_t> *b)
|
||||
{
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
}
|
||||
|
||||
std::set<size_t> GetAlignmentsForSource(size_t sourcePos) const;
|
||||
std::set<size_t> GetAlignmentsForTarget(size_t targetPos) const;
|
||||
|
||||
size_t GetSize() const {
|
||||
return m_collection.size();
|
||||
|
@ -16,6 +16,7 @@ protected:
|
||||
const TargetPhrase &m_targetPhrase;
|
||||
ScoreComponentCollection m_scoreBreakdown;
|
||||
const InputPath *m_inputPath;
|
||||
const std::vector<const Word*> *m_ruleSourceFromInputPath; // used by placeholders
|
||||
|
||||
public:
|
||||
ChartTranslationOption(const TargetPhrase &targetPhrase);
|
||||
@ -24,10 +25,15 @@ public:
|
||||
return m_targetPhrase;
|
||||
}
|
||||
|
||||
void SetInputPath(const InputPath *inputPath)
|
||||
{ m_inputPath = inputPath; }
|
||||
const InputPath *GetInputPath() const
|
||||
{ return m_inputPath; }
|
||||
void SetInputPath(const InputPath *inputPath)
|
||||
{ m_inputPath = inputPath; }
|
||||
|
||||
const std::vector<const Word*> *GetSourceRuleFromInputPath() const
|
||||
{ return m_ruleSourceFromInputPath; }
|
||||
void SetSourceRuleFromInputPath(const std::vector<const Word*> *obj)
|
||||
{ m_ruleSourceFromInputPath = obj; }
|
||||
|
||||
const ScoreComponentCollection &GetScores() const {
|
||||
return m_scoreBreakdown;
|
||||
|
Loading…
Reference in New Issue
Block a user