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, ScorePair > > 
Column

Public Member Functions

 ConfusionNet (AllOptions::ptr const &opts)
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 &, int format=0)
virtual void Print (std::ostream &) const
 Output debugging info to stream out.
int Read (std::istream &in)
 populate this InputType with data from in stream
Phrase GetSubString (const Range &) 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 (ttasksptr const &ttask) const
 create trans options specific to this InputType
const NonTerminalSetGetLabelSet (size_t, size_t) const

Protected Member Functions

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

Protected Attributes

std::vector< Columndata
NonTerminalSet m_defaultLabelSet


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 24 of file ConfusionNet.h.


Member Typedef Documentation

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

Definition at line 27 of file ConfusionNet.h.


Constructor & Destructor Documentation

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

Definition at line 65 of file ConfusionNet.cpp.

References Moses::CNStats::createOne(), Moses::InputFeature::InstancePtr(), Moses::is_syntax(), m_defaultLabelSet, NULL, Moses::stats, and UTIL_THROW_IF2.

Here is the call graph for this function:

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

Definition at line 76 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 82 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 64 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 ( ttasksptr const &  ttask  )  const [virtual]

create trans options specific to this InputType

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 279 of file ConfusionNet.cpp.

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

returns 1 for CNs

Definition at line 58 of file ConfusionNet.h.

References data.

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

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

Reimplemented in Moses::WordLattice.

Definition at line 57 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]

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

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

Definition at line 256 of file ConfusionNet.cpp.

References TRACE_ERR.

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

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

Implements Moses::InputType.

Definition at line 248 of file ConfusionNet.cpp.

References UTIL_THROW2.

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

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 43 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 264 of file ConfusionNet.cpp.

References UTIL_THROW2.

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

Definition at line 53 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 212 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  )  [virtual]

populate this InputType with data from in stream

Implements Moses::InputType.

Reimplemented in Moses::WordLattice.

Definition at line 111 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,
int  format = 0 
)

Definition at line 94 of file ConfusionNet.cpp.

References 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  )  [protected]

bool Moses::ConfusionNet::ReadFormat1 ( std::istream &  in  )  [protected]

Definition at line 178 of file ConfusionNet.cpp.

References Clear(), Moses::Word::CreateFromString(), data, Moses::Input, Moses::InputType::m_options, prob(), 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]


Member Data Documentation

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

Definition at line 31 of file ConfusionNet.h.

Referenced by ConfusionNet(), and GetLabelSet().


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

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