#include <AlignmentInfo.h>
Public Types | |
typedef std::set< std::pair < size_t, size_t > > | CollType |
typedef std::vector< size_t > | NonTermIndexMap |
typedef CollType::const_iterator | const_iterator |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
void | Add (size_t sourcePos, size_t targetPos) |
const NonTermIndexMap & | GetNonTermIndexMap () const |
const NonTermIndexMap & | GetNonTermIndexMap2 () const |
const CollType & | GetAlignments () const |
std::set< size_t > | GetAlignmentsForSource (size_t sourcePos) const |
std::set< size_t > | GetAlignmentsForTarget (size_t targetPos) const |
size_t | GetSize () const |
std::vector< const std::pair < size_t, size_t > * > | GetSortedAlignments (WordAlignmentSort SortOrder) const |
std::vector< size_t > | GetSourceIndex2PosMap () const |
bool | operator== (const AlignmentInfo &rhs) const |
Friends | |
struct | AlignmentInfoOrderer |
struct | AlignmentInfoHasher |
class | AlignmentInfoCollection |
class | VW |
std::ostream & | operator<< (std::ostream &, const AlignmentInfo &) |
Definition at line 38 of file AlignmentInfo.h.
typedef std::set<std::pair<size_t,size_t> > Moses::AlignmentInfo::CollType |
Definition at line 47 of file AlignmentInfo.h.
typedef CollType::const_iterator Moses::AlignmentInfo::const_iterator |
Definition at line 49 of file AlignmentInfo.h.
typedef std::vector<size_t> Moses::AlignmentInfo::NonTermIndexMap |
Definition at line 48 of file AlignmentInfo.h.
void Moses::AlignmentInfo::Add | ( | size_t | sourcePos, | |
size_t | targetPos | |||
) | [inline] |
Definition at line 58 of file AlignmentInfo.h.
const_iterator Moses::AlignmentInfo::begin | ( | ) | const [inline] |
Definition at line 51 of file AlignmentInfo.h.
Referenced by Moses::TargetWordInsertionFeature::ComputeFeatures(), Moses::SourceWordDeletionFeature::ComputeFeatures(), Moses::PhraseDecoder::DecodeCollection(), Moses::UnalignedWordCountFeature::EvaluateInIsolation(), Moses::RulePairUnlexicalizedSource::EvaluateInIsolation(), Moses::PhraseOrientationFeature::EvaluateInIsolation(), Moses::OpSequenceModel::EvaluateInIsolation(), Moses::SparseHieroReorderingFeature::EvaluateWhenApplied(), Moses::PhraseOrientationFeature::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::WordTranslationFeature::EvaluateWithSourceContext(), Moses::SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(), Moses::PhraseDictionaryMultiModelCounts::GetAlignmentsForLexWeights(), GetAlignmentsForSource(), GetAlignmentsForTarget(), Moses::PhraseDictionaryFuzzyMatch::GetOrCreateNode(), Moses::PhraseDictionaryMemory::GetOrCreateNode(), Moses::UTrieNode::GetOrCreateTargetPhraseCollection(), Moses::Syntax::S2T::RuleTrieScope3::Node::GetOrCreateTargetPhraseCollection(), Moses::operator<<(), MosesTraining::PhraseOrientation::PhraseOrientation(), and Moses::VWTargetSentence::SetConstraints().
const_iterator Moses::AlignmentInfo::end | ( | ) | const [inline] |
Definition at line 54 of file AlignmentInfo.h.
Referenced by Moses::TargetWordInsertionFeature::ComputeFeatures(), Moses::SourceWordDeletionFeature::ComputeFeatures(), Moses::PhraseDecoder::DecodeCollection(), Moses::UnalignedWordCountFeature::EvaluateInIsolation(), Moses::RulePairUnlexicalizedSource::EvaluateInIsolation(), Moses::PhraseOrientationFeature::EvaluateInIsolation(), Moses::OpSequenceModel::EvaluateInIsolation(), Moses::SparseHieroReorderingFeature::EvaluateWhenApplied(), Moses::PhraseOrientationFeature::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::WordTranslationFeature::EvaluateWithSourceContext(), Moses::SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(), Moses::PhraseDictionaryMultiModelCounts::GetAlignmentsForLexWeights(), GetAlignmentsForSource(), GetAlignmentsForTarget(), Moses::PhraseDictionaryFuzzyMatch::GetOrCreateNode(), Moses::PhraseDictionaryMemory::GetOrCreateNode(), Moses::UTrieNode::GetOrCreateTargetPhraseCollection(), Moses::Syntax::S2T::RuleTrieScope3::Node::GetOrCreateTargetPhraseCollection(), Moses::operator<<(), MosesTraining::PhraseOrientation::PhraseOrientation(), and Moses::VWTargetSentence::SetConstraints().
const CollType& Moses::AlignmentInfo::GetAlignments | ( | ) | const [inline] |
Definition at line 75 of file AlignmentInfo.h.
std::set< size_t > Moses::AlignmentInfo::GetAlignmentsForSource | ( | size_t | sourcePos | ) | const |
Definition at line 82 of file AlignmentInfo.cpp.
References begin(), and end().
Referenced by Moses::Manager::GetPlaceholders(), and Moses::Hypothesis::GetPlaceholders().
std::set< size_t > Moses::AlignmentInfo::GetAlignmentsForTarget | ( | size_t | targetPos | ) | const |
Definition at line 95 of file AlignmentInfo.cpp.
References begin(), and end().
Referenced by Moses::VWFeatureContext::GetAlignedSourceWords(), Moses::ChartKBestExtractor::GetOutputPhrase(), and Moses::ChartHypothesis::GetOutputPhrase().
const NonTermIndexMap& Moses::AlignmentInfo::GetNonTermIndexMap | ( | ) | const [inline] |
Provides a map from target-side to source-side non-terminal indices. The target-side index should be the rule symbol index (COUNTING terminals). The index returned is the rule non-terminal index (IGNORING terminals).
Definition at line 65 of file AlignmentInfo.h.
Referenced by Moses::RDLM::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), Moses::TreeStructureFeature::EvaluateWhenApplied(), Moses::TargetPreferencesFeature::EvaluateWhenApplied(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::SoftMatchingFeature::EvaluateWhenApplied(), Moses::PhraseOrientationFeature::EvaluateWhenApplied(), Moses::Syntax::KBestExtractor::GetOutputPhrase(), Moses::ChartKBestExtractor::GetOutputPhrase(), Moses::ChartHypothesis::GetOutputPhrase(), Moses::ChartKBestExtractor::GetOutputScoreBreakdown(), Moses::Syntax::KBestExtractor::GetOutputTree(), Moses::ChartKBestExtractor::GetOutputTree(), Moses::PhraseOrientationFeature::SparseWordL2RScore(), and Moses::PhraseOrientationFeature::SparseWordR2LScore().
const NonTermIndexMap& Moses::AlignmentInfo::GetNonTermIndexMap2 | ( | ) | const [inline] |
Like GetNonTermIndexMap but the return value is the symbol index (i.e. the index counting both terminals and non-terminals)
Definition at line 71 of file AlignmentInfo.h.
Referenced by Moses::Syntax::GetOneBestTargetYield().
size_t Moses::AlignmentInfo::GetSize | ( | ) | const [inline] |
Definition at line 82 of file AlignmentInfo.h.
Referenced by Moses::TargetWordInsertionFeature::ComputeFeatures(), Moses::SourceWordDeletionFeature::ComputeFeatures(), Moses::PhraseOrientationFeature::EvaluateInIsolation(), Moses::PhraseOrientationFeature::EvaluateWhenApplied(), Moses::UTrieNode::GetOrCreateTargetPhraseCollection(), and Moses::Syntax::S2T::RuleTrieScope3::Node::GetOrCreateTargetPhraseCollection().
std::vector< const std::pair< size_t, size_t > * > Moses::AlignmentInfo::GetSortedAlignments | ( | WordAlignmentSort | SortOrder | ) | const |
Definition at line 121 of file AlignmentInfo.cpp.
References Moses::compare_target(), Moses::NoSort, sort(), Moses::TargetOrder, and UTIL_THROW.
Referenced by Moses::Hypothesis::OutputAlignment().
std::vector< size_t > Moses::AlignmentInfo::GetSourceIndex2PosMap | ( | ) | const |
Definition at line 148 of file AlignmentInfo.cpp.
bool Moses::AlignmentInfo::operator== | ( | const AlignmentInfo & | rhs | ) | const [inline] |
Definition at line 91 of file AlignmentInfo.h.
friend class AlignmentInfoCollection [friend] |
Definition at line 43 of file AlignmentInfo.h.
friend struct AlignmentInfoHasher [friend] |
Definition at line 42 of file AlignmentInfo.h.
friend struct AlignmentInfoOrderer [friend] |
Definition at line 41 of file AlignmentInfo.h.
std::ostream& operator<< | ( | std::ostream & | out, | |
const AlignmentInfo & | alignmentInfo | |||
) | [friend] |
Definition at line 161 of file AlignmentInfo.cpp.
friend class VW [friend] |
Definition at line 44 of file AlignmentInfo.h.