#include <ConfusionNet.h>


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 Column & | GetColumn (size_t i) const |
| const Column & | operator[] (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 Word & | GetWord (size_t pos) const |
| return substring at a particular position. Only valid for Sentence class. TODO - get rid of this fn | |
| TranslationOptionCollection * | CreateTranslationOptionCollection (ttasksptr const &ttask) const |
| create trans options specific to this InputType | |
| const NonTerminalSet & | GetLabelSet (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< Column > | data |
| NonTerminalSet | m_defaultLabelSet |
Definition at line 24 of file ConfusionNet.h.
| typedef std::vector<std::pair<Word, ScorePair > > Moses::ConfusionNet::Column |
Definition at line 27 of file ConfusionNet.h.
| 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.

| Moses::ConfusionNet::~ConfusionNet | ( | ) | [virtual] |
Definition at line 76 of file ConfusionNet.cpp.
References Moses::CNStats::destroyOne(), and Moses::stats.

| Moses::ConfusionNet::ConfusionNet | ( | Sentence const & | s | ) |
Definition at line 82 of file ConfusionNet.cpp.
References data, Moses::Sentence::GetSize(), and Moses::Sentence::GetWord().

| void Moses::ConfusionNet::Clear | ( | ) | [inline] |
Definition at line 64 of file ConfusionNet.h.
References data.
Referenced by Moses::WordLattice::Read(), ReadFormat0(), and ReadFormat1().

| 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] |
| const Column& Moses::ConfusionNet::GetColumn | ( | size_t | i | ) | const [inline] |
Definition at line 47 of file ConfusionNet.h.
References data, and UTIL_THROW_IF2.
Referenced by Moses::TranslationOptionCollectionLattice::Extend(), operator[](), Moses::TranslationOptionCollectionConfusionNet::ProcessUnknownWord(), Moses::TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet(), and Moses::TranslationOptionCollectionLattice::TranslationOptionCollectionLattice().

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

| const NonTerminalSet& Moses::ConfusionNet::GetLabelSet | ( | size_t | , | |
| size_t | ||||
| ) | const [inline, virtual] |
Implements Moses::InputType.
Definition at line 80 of file ConfusionNet.h.
References m_defaultLabelSet.
Referenced by Moses::TranslationOptionCollectionLattice::Extend(), Moses::TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet(), and Moses::TranslationOptionCollectionLattice::TranslationOptionCollectionLattice().

| size_t Moses::ConfusionNet::GetSize | ( | ) | const [inline, virtual] |
number of words in this sentence/confusion network
Implements Moses::InputType.
Definition at line 61 of file ConfusionNet.h.
References data.
Referenced by Moses::PDTAimp::CacheSource(), Moses::CNStats::collect(), Moses::TranslationOptionCollectionLattice::Extend(), Moses::TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet(), and Moses::TranslationOptionCollectionLattice::TranslationOptionCollectionLattice().

| std::string Moses::ConfusionNet::GetStringRep | ( | const std::vector< FactorType > | factorsToPrint | ) | const |
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().

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

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

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


| bool Moses::ConfusionNet::ReadFormat0 | ( | std::istream & | in | ) | [protected] |
Definition at line 120 of file ConfusionNet.cpp.
References Clear(), Moses::Word::CreateFromString(), data, EPSILON, Moses::InputFeature::GetNumInputScores(), Moses::InputFeature::GetNumRealWordsInInput(), Moses::Input, Moses::InputFeature::InstancePtr(), Moses::LOWEST_SCORE, Moses::InputType::m_options, prob(), Moses::ShrinkToFit(), totalCount, TRACE_ERR, and VERBOSE.
Referenced by ReadF().


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


| void Moses::ConfusionNet::String2Word | ( | const std::string & | s, | |
| Word & | w, | |||
| const std::vector< FactorType > & | factorOrder | |||
| ) | [protected] |
std::vector<Column> Moses::ConfusionNet::data [protected] |
Definition at line 30 of file ConfusionNet.h.
Referenced by Clear(), ConfusionNet(), Empty(), Moses::WordLattice::GetAsEdgeMatrix(), GetColumn(), GetSize(), Moses::WordLattice::InitializeFromPCNDataType(), Moses::WordLattice::Print(), Print(), ReadFormat0(), and ReadFormat1().
NonTerminalSet Moses::ConfusionNet::m_defaultLabelSet [protected] |
1.5.9