#include <WordLattice.h>
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 ¤t) 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 |
TranslationOptionCollection * | CreateTranslationOptionCollection (ttasksptr const &ttask) const |
create trans options specific to this InputType | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const WordLattice &obj) |
Definition at line 18 of file WordLattice.h.
Moses::WordLattice::WordLattice | ( | AllOptions::ptr const & | opts | ) |
Definition at line 14 of file WordLattice.cpp.
References Moses::InputFeature::InstancePtr(), NULL, and UTIL_THROW_IF2.
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.
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.
void Moses::WordLattice::GetAsEdgeMatrix | ( | std::vector< std::vector< bool > > & | edges | ) | const |
Convert internal representation into an edge matrix
Definition at line 164 of file WordLattice.cpp.
References Moses::ConfusionNet::data.
Referenced by InitializeFromPCNDataType().
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().
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().
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().
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().
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().
std::ostream& operator<< | ( | std::ostream & | out, | |
const WordLattice & | obj | |||
) | [friend] |
Definition at line 236 of file WordLattice.cpp.