Moses::InputType Class Reference

base class for sentences and confusion networks More...

#include <InputType.h>

Inheritance diagram for Moses::InputType:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 InputType (long translationId=0)
virtual ~InputType ()
virtual InputTypeEnum GetType () const =0
long GetTranslationId () const
void SetTranslationId (long translationId)
virtual int ComputeDistortionDistance (const WordsRange &prev, const WordsRange &current) const
 returns the number of words moved
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.
bool IsCoveragePossible (const WordsRange &range) const
 is there a path covering [range] (lattice only, otherwise true)
bool IsExtensionPossible (const WordsRange &prev, const WordsRange &current) const
 In a word lattice, you can't always get from node A to node B.
virtual size_t GetSize () const =0
 number of words in this sentence/confusion network
virtual int Read (std::istream &in, const std::vector< FactorType > &factorOrder)=0
 populate this InputType with data from in stream
virtual void Print (std::ostream &) const =0
 Output debugging info to stream out.
virtual
TranslationOptionCollection
CreateTranslationOptionCollection (const TranslationSystem *system) const =0
 create trans options specific to this InputType
virtual Phrase GetSubString (const WordsRange &) const =0
 return substring. Only valid for Sentence class. TODO - get rid of this fn
virtual const WordGetWord (size_t pos) const =0
 return substring at a particular position. Only valid for Sentence class. TODO - get rid of this fn
const ReorderingConstraintGetReorderingConstraint () const
 Returns the reordering constraints.
virtual const NonTerminalSetGetLabelSet (size_t startPos, size_t endPos) const =0
 TO_STRING ()

Public Attributes

std::vector< bool > m_sourceCompleted
std::string m_initialTargetPhrase
size_t m_frontSpanCoveredLength

Protected Attributes

long m_translationId
bool m_hasMetaData
long m_segId
ReorderingConstraint m_reorderingConstraint


Detailed Description

base class for sentences and confusion networks

Definition at line 43 of file InputType.h.


Constructor & Destructor Documentation

Moses::InputType::InputType ( long  translationId = 0  ) 

Definition at line 30 of file InputType.cpp.

References m_frontSpanCoveredLength, and m_sourceCompleted.

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

Definition at line 36 of file InputType.cpp.


Member Function Documentation

bool Moses::InputType::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 in Moses::WordLattice.

Definition at line 58 of file InputType.cpp.

Referenced by IsCoveragePossible(), IsExtensionPossible(), and Moses::SearchNormal::ProcessOneHypothesis().

Here is the caller graph for this function:

int Moses::InputType::ComputeDistortionDistance ( const WordsRange prev,
const WordsRange current 
) const [virtual]

returns the number of words moved

Reimplemented in Moses::WordLattice.

Definition at line 47 of file InputType.cpp.

References Moses::WordsRange::GetEndPos(), Moses::WordsRange::GetNumWordsCovered(), and Moses::WordsRange::GetStartPos().

Referenced by Moses::BackwardsEdge::BackwardsEdge(), Moses::DistortionScoreProducer::CalculateDistortionScore(), Moses::SearchCubePruning::CheckDistortion(), and Moses::SearchNormal::ProcessOneHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual TranslationOptionCollection* Moses::InputType::CreateTranslationOptionCollection ( const TranslationSystem system  )  const [pure virtual]

create trans options specific to this InputType

Implemented in Moses::ConfusionNet, and Moses::Sentence.

virtual const NonTerminalSet& Moses::InputType::GetLabelSet ( size_t  startPos,
size_t  endPos 
) const [pure virtual]

Implemented in Moses::ConfusionNet, Moses::Sentence, Moses::TreeInput, and Moses::WordLattice.

Referenced by Moses::ChartRuleLookupManagerOnDisk::GetChartRuleCollection().

Here is the caller graph for this function:

const ReorderingConstraint& Moses::InputType::GetReorderingConstraint (  )  const [inline]

Returns the reordering constraints.

Definition at line 127 of file InputType.h.

References m_reorderingConstraint.

Referenced by Moses::SearchCubePruning::CheckDistortion(), and Moses::SearchNormal::ProcessOneHypothesis().

Here is the caller graph for this function:

virtual size_t Moses::InputType::GetSize (  )  const [pure virtual]

virtual Phrase Moses::InputType::GetSubString ( const WordsRange  )  const [pure virtual]

long Moses::InputType::GetTranslationId (  )  const [inline]

Definition at line 64 of file InputType.h.

References m_translationId.

Referenced by IOWrapper::GetInput(), Moses::PhraseDictionaryALSuffixArray::InitializeForInput(), and Moses::SearchNormal::SearchNormal().

Here is the caller graph for this function:

virtual InputTypeEnum Moses::InputType::GetType (  )  const [pure virtual]

Implemented in Moses::ConfusionNet, Moses::Sentence, and Moses::TreeInput.

Referenced by Moses::TranslationOption::TranslationOption().

Here is the caller graph for this function:

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

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

Implemented in Moses::ConfusionNet, and Moses::Sentence.

Referenced by Moses::ChartCell::ChartCell(), Moses::ChartTranslationOptionCollection::CreateTranslationOptionsForRange(), and Moses::TranslationOptionCollectionText::ProcessUnknownWord().

Here is the caller graph for this function:

bool Moses::InputType::IsCoveragePossible ( const WordsRange range  )  const [inline]

is there a path covering [range] (lattice only, otherwise true)

Definition at line 77 of file InputType.h.

References CanIGetFromAToB(), Moses::WordsRange::GetEndPos(), and Moses::WordsRange::GetStartPos().

Referenced by Moses::SearchNormal::ProcessOneHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::InputType::IsExtensionPossible ( const WordsRange prev,
const WordsRange current 
) const [inline]

In a word lattice, you can't always get from node A to node B.

Definition at line 82 of file InputType.h.

References CanIGetFromAToB(), Moses::WordsRange::GetEndPos(), and Moses::WordsRange::GetStartPos().

Here is the call graph for this function:

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

Output debugging info to stream out.

Implemented in Moses::ConfusionNet, Moses::Sentence, Moses::TreeInput, and Moses::WordLattice.

Referenced by Moses::operator<<().

Here is the caller graph for this function:

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

populate this InputType with data from in stream

Implemented in Moses::ConfusionNet, Moses::Sentence, Moses::TreeInput, and Moses::WordLattice.

Referenced by IOWrapper::GetInput().

Here is the caller graph for this function:

void Moses::InputType::SetTranslationId ( long  translationId  )  [inline]

Definition at line 67 of file InputType.h.

References m_translationId.

Referenced by IOWrapper::GetInput(), Moses::WordLattice::Read(), and Moses::Sentence::Read().

Here is the caller graph for this function:

Moses::InputType::TO_STRING (  ) 


Member Data Documentation

Definition at line 47 of file InputType.h.

Definition at line 55 of file InputType.h.

Referenced by Moses::Sentence::Read().

limits on reordering specified either by "-mp" switch or xml tags

Definition at line 49 of file InputType.h.

Referenced by GetReorderingConstraint(), and Moses::Sentence::Read().

long Moses::InputType::m_segId [protected]

Definition at line 48 of file InputType.h.

Definition at line 54 of file InputType.h.

Referenced by InputType(), and Moses::Sentence::Read().

Definition at line 46 of file InputType.h.

Referenced by GetTranslationId(), and SetTranslationId().


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

Generated on Wed Feb 8 22:04:09 2012 for Moses by  doxygen 1.5.9