Moses::AlignmentInfo Class Reference

#include <AlignmentInfo.h>

List of all members.

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 NonTermIndexMapGetNonTermIndexMap () const
const NonTermIndexMapGetNonTermIndexMap2 () const
const CollTypeGetAlignments () 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 &)


Detailed Description

Collection of non-terminal alignment pairs, ordered by source index. Usually held by a TargetPhrase to map non-terms in hierarchical/syntax models

Definition at line 38 of file AlignmentInfo.h.


Member Typedef Documentation

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.


Member Function Documentation

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]

const_iterator Moses::AlignmentInfo::end (  )  const [inline]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

const NonTermIndexMap& Moses::AlignmentInfo::GetNonTermIndexMap (  )  const [inline]

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().

Here is the caller graph for this function:

size_t Moses::AlignmentInfo::GetSize (  )  const [inline]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.


Friends And Related Function Documentation

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.


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:32:51 2017 for Moses by  doxygen 1.5.9