Moses::WordLattice Class Reference

#include <WordLattice.h>

Inheritance diagram for Moses::WordLattice:

Inheritance graph
[legend]
Collaboration diagram for Moses::WordLattice:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 WordLattice (AllOptions::ptr const &opts)
InputTypeEnum GetType () const
size_t GetColumnIncrement (size_t ic, size_t j) const
void Print (std::ostream &) const
 Output debugging info to stream out.
virtual int ComputeDistortionDistance (const Range &prev, const Range &current) const
virtual bool CanIGetFromAToB (size_t start, size_t end) const
 In a word lattice, tells you if there's a path from node start to node end.
int InitializeFromPCNDataType (const PCN::CN &cn, const std::string &debug_line="")
int Read (std::istream &in)
void GetAsEdgeMatrix (std::vector< std::vector< bool > > &edges) const
const std::vector< size_t > & GetNextNodes (size_t pos) const
TranslationOptionCollectionCreateTranslationOptionCollection (ttasksptr const &ttask) const
 create trans options specific to this InputType

Friends

std::ostream & operator<< (std::ostream &out, const WordLattice &obj)


Detailed Description

An input to the decoder that represent a word lattice.
Todo:
why is this inherited from confusion net?

Definition at line 18 of file WordLattice.h.


Constructor & Destructor Documentation

Moses::WordLattice::WordLattice ( AllOptions::ptr const &  opts  ) 

Definition at line 14 of file WordLattice.cpp.

References Moses::InputFeature::InstancePtr(), NULL, and UTIL_THROW_IF2.

Here is the call graph for this function:


Member Function Documentation

bool Moses::WordLattice::CanIGetFromAToB ( size_t  start,
size_t  end 
) const [virtual]

In a word lattice, tells you if there's a path from node start to node end.

Reimplemented from Moses::InputType.

Definition at line 215 of file WordLattice.cpp.

int Moses::WordLattice::ComputeDistortionDistance ( const Range prev,
const Range current 
) const [virtual]

Get shortest path between two nodes

Reimplemented from Moses::InputType.

Definition at line 174 of file WordLattice.cpp.

References Moses::Range::GetEndPos(), Moses::Range::GetStartPos(), NOT_FOUND, TRACE_ERR, and VERBOSE.

Here is the call graph for this function:

TranslationOptionCollection * Moses::WordLattice::CreateTranslationOptionCollection ( ttasksptr const &  ttask  )  const [virtual]

create trans options specific to this InputType

Reimplemented from Moses::ConfusionNet.

Definition at line 223 of file WordLattice.cpp.

References Moses::StaticData::Instance(), and NULL.

Here is the call graph for this function:

void Moses::WordLattice::GetAsEdgeMatrix ( std::vector< std::vector< bool > > &  edges  )  const

Convert internal representation into an edge matrix

Note:
edges[1][2] means there is an edge from 1 to 2

Definition at line 164 of file WordLattice.cpp.

References Moses::ConfusionNet::data.

Referenced by InitializeFromPCNDataType().

Here is the caller graph for this function:

size_t Moses::WordLattice::GetColumnIncrement ( size_t  ic,
size_t  j 
) const [virtual]

Reimplemented from Moses::ConfusionNet.

Definition at line 20 of file WordLattice.cpp.

Referenced by Print().

Here is the caller graph for this function:

const std::vector<size_t>& Moses::WordLattice::GetNextNodes ( size_t  pos  )  const [inline]

Definition at line 54 of file WordLattice.h.

Referenced by Moses::TranslationOptionCollectionLattice::Extend(), and Moses::TranslationOptionCollectionLattice::TranslationOptionCollectionLattice().

Here is the caller graph for this function:

InputTypeEnum Moses::WordLattice::GetType (  )  const [inline, virtual]

Reimplemented from Moses::ConfusionNet.

Definition at line 28 of file WordLattice.h.

References Moses::WordLatticeInput.

int Moses::WordLattice::InitializeFromPCNDataType ( const PCN::CN cn,
const std::string &  debug_line = "" 
)

Given a lattice represented using the PCN::CN data type (topologically sorted agency list representation), initialize the WordLattice object

Definition at line 55 of file WordLattice.cpp.

References Moses::Word::CreateFromString(), Moses::ConfusionNet::data, Moses::ScorePair::denseScores, EPSILON, floyd_warshall(), GetAsEdgeMatrix(), Moses::InputFeature::GetNumInputScores(), Moses::InputFeature::GetNumRealWordsInInput(), IFVERBOSE, Moses::Input, Moses::InputFeature::InstancePtr(), Moses::LOWEST_SCORE, PCN::CNAlt::m_denseFeatures, PCN::CNAlt::m_next, Moses::InputType::m_options, PCN::CNAlt::m_word, and TRACE_ERR.

Referenced by Read().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::WordLattice::Print ( std::ostream &   )  const [virtual]

Output debugging info to stream out.

Reimplemented from Moses::ConfusionNet.

Definition at line 25 of file WordLattice.cpp.

References Moses::ConfusionNet::data, and GetColumnIncrement().

Here is the call graph for this function:

int Moses::WordLattice::Read ( std::istream &  in  )  [virtual]

Read from PLF format (1 lattice per line)

Reimplemented from Moses::ConfusionNet.

Definition at line 150 of file WordLattice.cpp.

References Moses::ConfusionNet::Clear(), InitializeFromPCNDataType(), PCN::parsePCN(), Moses::ProcessAndStripSGML(), and Moses::InputType::SetTranslationId().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const WordLattice obj 
) [friend]

Definition at line 236 of file WordLattice.cpp.


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

Generated on Thu Jul 6 00:33:58 2017 for Moses by  doxygen 1.5.9