Moses::ConfusionNet Class Reference

#include <ConfusionNet.h>

Inheritance diagram for Moses::ConfusionNet:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< std::pair
< Word, std::vector< float > > > 
Column

Public Member Functions

 ConfusionNet ()
virtual ~ConfusionNet ()
 ConfusionNet (Sentence const &s)
InputTypeEnum GetType () const
const ColumnGetColumn (size_t i) const
const Columnoperator[] (size_t i) const
virtual size_t GetColumnIncrement (size_t i, size_t j) const
bool Empty () const
 returns 1 for CNs
size_t GetSize () const
 number of words in this sentence/confusion network
void Clear ()
bool ReadF (std::istream &, const std::vector< FactorType > &factorOrder, int format=0)
virtual void Print (std::ostream &) const
 Output debugging info to stream out.
int Read (std::istream &in, const std::vector< FactorType > &factorOrder)
 populate this InputType with data from in stream
Phrase GetSubString (const WordsRange &) const
 return substring. Only valid for Sentence class. TODO - get rid of this fn
std::string GetStringRep (const std::vector< FactorType > factorsToPrint) const
const WordGetWord (size_t pos) const
 return substring at a particular position. Only valid for Sentence class. TODO - get rid of this fn
TranslationOptionCollectionCreateTranslationOptionCollection () const
 create trans options specific to this InputType
const NonTerminalSetGetLabelSet (size_t, size_t) const

Protected Member Functions

bool ReadFormat0 (std::istream &, const std::vector< FactorType > &factorOrder)
bool ReadFormat1 (std::istream &, const std::vector< FactorType > &factorOrder)
void String2Word (const std::string &s, Word &w, const std::vector< FactorType > &factorOrder)

Protected Attributes

std::vector< Columndata


Detailed Description

An input to the decoder where each position can be 1 of a number of words, each with an associated probability. Compared with a sentence, where each position is a word

Definition at line 21 of file ConfusionNet.h.


Member Typedef Documentation

typedef std::vector<std::pair<Word,std::vector<float> > > Moses::ConfusionNet::Column

Definition at line 24 of file ConfusionNet.h.


Constructor & Destructor Documentation

Moses::ConfusionNet::ConfusionNet (  ) 

Definition at line 63 of file ConfusionNet.cpp.

References Moses::CNStats::createOne(), and Moses::stats.

Here is the call graph for this function:

Moses::ConfusionNet::~ConfusionNet (  )  [virtual]

Definition at line 68 of file ConfusionNet.cpp.

References Moses::CNStats::destroyOne(), and Moses::stats.

Here is the call graph for this function:

Moses::ConfusionNet::ConfusionNet ( Sentence const &  s  ) 

Definition at line 73 of file ConfusionNet.cpp.

References data, Moses::Sentence::GetSize(), and Moses::Sentence::GetWord().

Here is the call graph for this function:


Member Function Documentation

void Moses::ConfusionNet::Clear (  )  [inline]

Definition at line 58 of file ConfusionNet.h.

References data.

Referenced by Moses::WordLattice::Read(), ReadFormat0(), and ReadFormat1().

Here is the caller graph for this function:

TranslationOptionCollection * Moses::ConfusionNet::CreateTranslationOptionCollection (  )  const [virtual]

create trans options specific to this InputType

Implements Moses::InputType.

Definition at line 251 of file ConfusionNet.cpp.

References CHECK, Moses::StaticData::GetMaxNoTransOptPerCoverage(), Moses::StaticData::GetTranslationOptionThreshold(), and Moses::StaticData::Instance().

Here is the call graph for this function:

bool Moses::ConfusionNet::Empty (  )  const [inline]

returns 1 for CNs

Definition at line 52 of file ConfusionNet.h.

References data.

const Column& Moses::ConfusionNet::GetColumn ( size_t  i  )  const [inline]

Definition at line 43 of file ConfusionNet.h.

References CHECK, and data.

Referenced by operator[](), and Moses::TranslationOptionCollectionConfusionNet::ProcessUnknownWord().

Here is the caller graph for this function:

size_t Moses::ConfusionNet::GetColumnIncrement ( size_t  i,
size_t  j 
) const [virtual]

Reimplemented in Moses::WordLattice.

Definition at line 56 of file ConfusionNet.cpp.

Referenced by Moses::PDTAimp::CacheSource(), and Moses::TranslationOptionCollectionConfusionNet::ProcessUnknownWord().

Here is the caller graph for this function:

const NonTerminalSet& Moses::ConfusionNet::GetLabelSet ( size_t  ,
size_t   
) const [inline, virtual]

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 73 of file ConfusionNet.h.

References CHECK.

size_t Moses::ConfusionNet::GetSize (  )  const [inline, virtual]

number of words in this sentence/confusion network

Implements Moses::InputType.

Definition at line 55 of file ConfusionNet.h.

References data.

Referenced by Moses::PDTAimp::CacheSource(), and Moses::CNStats::collect().

Here is the caller graph for this function:

std::string Moses::ConfusionNet::GetStringRep ( const std::vector< FactorType factorsToPrint  )  const

Definition at line 228 of file ConfusionNet.cpp.

References TRACE_ERR.

Phrase Moses::ConfusionNet::GetSubString ( const WordsRange  )  const [virtual]

return substring. Only valid for Sentence class. TODO - get rid of this fn

Implements Moses::InputType.

Definition at line 221 of file ConfusionNet.cpp.

References TRACE_ERR.

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

Implements Moses::InputType.

Definition at line 39 of file ConfusionNet.h.

References Moses::ConfusionNetworkInput.

const Word & Moses::ConfusionNet::GetWord ( size_t  pos  )  const [virtual]

return substring at a particular position. Only valid for Sentence class. TODO - get rid of this fn

Implements Moses::InputType.

Definition at line 236 of file ConfusionNet.cpp.

References TRACE_ERR.

const Column& Moses::ConfusionNet::operator[] ( size_t  i  )  const [inline]

Definition at line 47 of file ConfusionNet.h.

References GetColumn().

Here is the call graph for this function:

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

Output debugging info to stream out.

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 201 of file ConfusionNet.cpp.

References data.

Referenced by main(), and Moses::operator<<().

Here is the caller graph for this function:

int Moses::ConfusionNet::Read ( std::istream &  in,
const std::vector< FactorType > &  factorOrder 
) [virtual]

populate this InputType with data from in stream

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 99 of file ConfusionNet.cpp.

References Moses::CNStats::collect(), ReadF(), and Moses::stats.

Here is the call graph for this function:

bool Moses::ConfusionNet::ReadF ( std::istream &  in,
const std::vector< FactorType > &  factorOrder,
int  format = 0 
)

Definition at line 80 of file ConfusionNet.cpp.

References Moses::UserMessage::Add(), ReadFormat0(), ReadFormat1(), and VERBOSE.

Referenced by main(), and Read().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::ConfusionNet::ReadFormat0 ( std::istream &  in,
const std::vector< FactorType > &  factorOrder 
) [protected]

bool Moses::ConfusionNet::ReadFormat1 ( std::istream &  in,
const std::vector< FactorType > &  factorOrder 
) [protected]

Definition at line 169 of file ConfusionNet.cpp.

References Clear(), data, line, prob(), String2Word(), and VERBOSE.

Referenced by ReadF().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::ConfusionNet::String2Word ( const std::string &  s,
Word w,
const std::vector< FactorType > &  factorOrder 
) [protected]

Definition at line 108 of file ConfusionNet.cpp.

References Moses::FactorCollection::AddFactor(), Moses::Input, Moses::FactorCollection::Instance(), Moses::Word::SetFactor(), and Moses::Tokenize().

Referenced by Moses::WordLattice::InitializeFromPCNDataType(), ReadFormat0(), and ReadFormat1().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::vector<Column> Moses::ConfusionNet::data [protected]


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

Generated on Tue Sep 2 00:31:47 2014 for Moses by  doxygen 1.5.9