Moses::InputType Class Reference

#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 (AllOptions::ptr const &opts, long translationId=0)
virtual ~InputType ()
virtual InputTypeEnum GetType () const =0
AllOptions::ptr const & options () const
long GetTranslationId () const
void SetTranslationId (long translationId)
long GetDocumentId () const
void SetDocumentId (long documentId)
long GetTopicId () const
void SetTopicId (long topicId)
const std::vector< std::string > * GetTopicIdAndProb () const
void SetTopicIdAndProb (std::vector< std::string > topicIdAndProb)
bool GetUseTopicId () const
void SetUseTopicId (bool useTopicId)
bool GetUseTopicIdAndProb () const
void SetUseTopicIdAndProb (bool useTopicIdAndProb)
std::string GetTextType () const
void SetSpecifiesWeightSetting (bool specifiesWeightSetting)
bool GetSpecifiesWeightSetting () const
void SetWeightSetting (std::string settingName)
std::string GetWeightSetting () const
void SetTextType (std::string type)
std::string GetPassthroughInformation () const
void SetPassthroughInformation (std::string &passthrough)
virtual int ComputeDistortionDistance (const Range &prev, const Range &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 Range &range) const
 is there a path covering [range] (lattice only, otherwise true)
bool IsExtensionPossible (const Range &prev, const Range &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 boost::shared_ptr
< std::vector< std::string >
> const & 
GetContext () const
virtual void SetContext (boost::shared_ptr< std::vector< std::string > > const &ctx)
virtual int Read (std::istream &in)=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 (ttasksptr const &ttask) const =0
 create trans options specific to this InputType
virtual Phrase GetSubString (const Range &) 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
virtual std::vector
< ChartTranslationOptions * > 
GetXmlChartTranslationOptions () const
 TO_STRING ()

Public Attributes

std::vector< bool > m_sourceCompleted
std::string m_initialTargetPhrase
size_t m_frontSpanCoveredLength
SPTR< std::map< size_t const,
std::vector< float > > > 
m_coordMap

Protected Attributes

AllOptions::ptr m_options
long m_translationId
long m_documentId
long m_topicId
std::string m_weightSetting
std::vector< std::string > m_topicIdAndProb
bool m_useTopicId
bool m_useTopicIdAndProb
bool m_hasMetaData
bool m_specifiesWeightSetting
long m_segId
ReorderingConstraint m_reorderingConstraint
std::string m_textType
std::string m_passthrough
boost::shared_ptr< std::vector
< std::string > > 
m_context


Detailed Description

base class for all types of inputs to the decoder, eg. sentences, confusion networks, lattices and tree

Definition at line 45 of file InputType.h.


Constructor & Destructor Documentation

Moses::InputType::InputType ( AllOptions::ptr const &  opts,
long  translationId = 0 
)

Definition at line 32 of file InputType.cpp.

References m_frontSpanCoveredLength, and m_sourceCompleted.

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

Definition at line 41 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 63 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 Range prev,
const Range current 
) const [virtual]

returns the number of words moved

Reimplemented in Moses::WordLattice.

Definition at line 52 of file InputType.cpp.

References Moses::Range::GetEndPos(), Moses::Range::GetNumWordsCovered(), and Moses::Range::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 ( ttasksptr const &  ttask  )  const [pure virtual]

create trans options specific to this InputType

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

virtual boost::shared_ptr<std::vector<std::string> > const& Moses::InputType::GetContext (  )  const [inline, virtual]

Definition at line 185 of file InputType.h.

References m_context.

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

Definition at line 89 of file InputType.h.

References m_documentId.

Referenced by Moses::WordTranslationFeature::EvaluateWithSourceContext(), and Moses::PhrasePairFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

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

std::string Moses::InputType::GetPassthroughInformation (  )  const [inline]

Definition at line 137 of file InputType.h.

References m_passthrough.

Referenced by Moses::Manager::OutputPassthroughInformation().

Here is the caller graph for this function:

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

Returns the reordering constraints.

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

number of words in this sentence/confusion network

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

Referenced by Moses::TranslationOptionCollection::Add(), Moses::TranslationOptionCollection::CacheLexReordering(), Moses::TranslationOptionCollection::CalcEstimatedScore(), Moses::ChartCellCollectionBase::ChartCellCollectionBase(), Moses::ChartParser::Create(), Moses::SearchCubePruning::CreateForwardTodos(), Moses::LRModel::CreateLRState(), Moses::TranslationOptionCollection::CreateTranslationOptions(), Moses::Syntax::S2T::Manager< Parser >::Decode(), Moses::ChartManager::Decode(), Moses::TranslationOptionCollection::EvaluateWithSourceContext(), Moses::WordTranslationFeature::EvaluateWithSourceContext(), Moses::Syntax::T2S::Manager< RuleMatcher >::ExtractKBest(), Moses::Syntax::S2T::Manager< Parser >::ExtractKBest(), Moses::ChartManager::GetBestHypothesis(), Moses::Syntax::S2T::Manager< Parser >::GetBestSHyperedge(), Moses::ChartParser::GetSize(), Moses::LanguageModelChartState::hash(), Moses::SentenceStats::Initialize(), Moses::PhraseDictionaryFuzzyMatch::InitializeForInput(), Moses::VWFeatureSourceSenseWindow::InitializeForInput(), Moses::VW::InitializeForInput(), Moses::VWFeatureSourceWindow::operator()(), Moses::VWFeatureSourceSenseWindow::operator()(), Moses::VWFeatureSourceBigrams::operator()(), Moses::VWFeatureSourceBagOfWords::operator()(), Moses::operator<<(), Moses::LanguageModelChartState::operator==(), Moses::Manager::OutputInput(), Moses::Hypothesis::OutputInput(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::SearchNormal::ProcessOneHypothesis(), Moses::TranslationOptionCollection::ProcessUnknownWord(), Moses::TranslationOptionCollection::Prune(), Moses::TranslationOptionCollection::Sort(), Moses::TargetNgramChartState::TargetNgramChartState(), and Moses::TranslationOptionCollection::TranslationOptionCollection().

Here is the caller graph for this function:

bool Moses::InputType::GetSpecifiesWeightSetting (  )  const [inline]

Definition at line 125 of file InputType.h.

References m_specifiesWeightSetting.

Referenced by Moses::Manager::Decode().

Here is the caller graph for this function:

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

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

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

Referenced by Moses::PhraseDictionaryTreeAdaptor::GetTargetPhraseCollectionLEGACY(), Moses::DecodeStepTranslation::ProcessInitialTranslation(), and Moses::DecodeStepTranslation::ProcessInitialTransLEGACY().

Here is the caller graph for this function:

std::string Moses::InputType::GetTextType (  )  const [inline]

Definition at line 119 of file InputType.h.

References m_textType.

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

Definition at line 95 of file InputType.h.

References m_topicId.

Referenced by Moses::WordTranslationFeature::EvaluateWithSourceContext(), and Moses::PhrasePairFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

const std::vector<std::string>* Moses::InputType::GetTopicIdAndProb (  )  const [inline]

Definition at line 101 of file InputType.h.

References m_topicIdAndProb.

Referenced by Moses::WordTranslationFeature::EvaluateWithSourceContext(), and Moses::PhrasePairFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

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

Definition at line 83 of file InputType.h.

References m_translationId.

Referenced by Moses::PhraseDictionaryFuzzyMatch::CleanUpAfterSentenceProcessing(), Moses::OxLM< Model >::CleanUpAfterSentenceProcessing(), Moses::Manager::Decode(), Moses::CoveredReferenceFeature::EvaluateWhenApplied(), Moses::CoveredReferenceFeature::EvaluateWithSourceContext(), Moses::GetConstraint(), Moses::PhraseDictionaryFuzzyMatch::GetRootNode(), Moses::ChartParser::GetTranslationId(), Moses::PhraseDictionaryFuzzyMatch::InitializeForInput(), Moses::PhraseDictionaryALSuffixArray::InitializeForInput(), Moses::OxLM< Model >::InitializeForInput(), Moses::Manager::OutputAlignment(), Moses::ChartManager::OutputAlignment(), Moses::Syntax::Manager::OutputBest(), Moses::Manager::OutputBest(), Moses::Incremental::Manager::OutputBest(), Moses::ChartManager::OutputBest(), Moses::Syntax::T2S::Manager< RuleMatcher >::OutputDetailedTranslationReport(), Moses::Syntax::S2T::Manager< Parser >::OutputDetailedTranslationReport(), Moses::Syntax::F2S::Manager< RuleMatcher >::OutputDetailedTranslationReport(), Moses::Manager::OutputDetailedTranslationReport(), Moses::Incremental::Manager::OutputDetailedTranslationReport(), Moses::ChartManager::OutputDetailedTranslationReport(), Moses::Incremental::Manager::OutputDetailedTreeFragmentsTranslationReport(), Moses::ChartManager::OutputDetailedTreeFragmentsTranslationReport(), Moses::Manager::OutputLatticeSamples(), Moses::Syntax::Manager::OutputNBest(), Moses::Manager::OutputNBest(), Moses::Incremental::Manager::OutputNBest(), Moses::ChartManager::OutputNBest(), Moses::Manager::OutputSearchGraph(), Moses::ChartManager::OutputSearchGraph(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::ChartManager::OutputSearchGraphMoses(), Moses::Manager::OutputSearchGraphSLF(), Moses::Syntax::Manager::OutputUnknowns(), Moses::Manager::OutputUnknowns(), Moses::ChartManager::OutputUnknowns(), and Moses::Manager::OutputWordGraph().

Here is the caller graph for this function:

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

bool Moses::InputType::GetUseTopicId (  )  const [inline]

Definition at line 107 of file InputType.h.

References m_useTopicId.

Referenced by Moses::WordTranslationFeature::EvaluateWithSourceContext(), and Moses::PhrasePairFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

bool Moses::InputType::GetUseTopicIdAndProb (  )  const [inline]

Definition at line 113 of file InputType.h.

References m_useTopicIdAndProb.

Referenced by Moses::WordTranslationFeature::EvaluateWithSourceContext(), and Moses::PhrasePairFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

std::string Moses::InputType::GetWeightSetting (  )  const [inline]

Definition at line 131 of file InputType.h.

References m_weightSetting.

Referenced by Moses::Manager::Decode().

Here is the caller graph for this function:

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

std::vector< ChartTranslationOptions * > Moses::InputType::GetXmlChartTranslationOptions (  )  const [virtual]

Reimplemented in Moses::Sentence.

Definition at line 68 of file InputType.cpp.

Referenced by Moses::ChartManager::AddXmlChartOptions().

Here is the caller graph for this function:

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

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

Definition at line 150 of file InputType.h.

References CanIGetFromAToB(), Moses::Range::GetEndPos(), and Moses::Range::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 Range prev,
const Range current 
) const [inline]

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

Definition at line 155 of file InputType.h.

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

Here is the call graph for this function:

AllOptions::ptr const& Moses::InputType::options (  )  const [inline]

Definition at line 79 of file InputType.h.

References m_options.

Referenced by Moses::BackwardsEdge::BackwardsEdge(), and Moses::TranslationOptionCollectionLattice::TranslationOptionCollectionLattice().

Here is the caller 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::ForestInput, 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  )  [pure virtual]

virtual void Moses::InputType::SetContext ( boost::shared_ptr< std::vector< std::string > > const &  ctx  )  [inline, virtual]

Definition at line 190 of file InputType.h.

References m_context.

void Moses::InputType::SetDocumentId ( long  documentId  )  [inline]

Definition at line 92 of file InputType.h.

References m_documentId.

void Moses::InputType::SetPassthroughInformation ( std::string &  passthrough  )  [inline]

Definition at line 140 of file InputType.h.

References m_passthrough.

void Moses::InputType::SetSpecifiesWeightSetting ( bool  specifiesWeightSetting  )  [inline]

Definition at line 122 of file InputType.h.

References m_specifiesWeightSetting.

void Moses::InputType::SetTextType ( std::string  type  )  [inline]

Definition at line 134 of file InputType.h.

References m_textType.

void Moses::InputType::SetTopicId ( long  topicId  )  [inline]

Definition at line 98 of file InputType.h.

References m_topicId.

void Moses::InputType::SetTopicIdAndProb ( std::vector< std::string >  topicIdAndProb  )  [inline]

Definition at line 104 of file InputType.h.

References m_topicIdAndProb.

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

Definition at line 86 of file InputType.h.

References m_translationId.

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

Here is the caller graph for this function:

void Moses::InputType::SetUseTopicId ( bool  useTopicId  )  [inline]

Definition at line 110 of file InputType.h.

References m_useTopicId.

void Moses::InputType::SetUseTopicIdAndProb ( bool  useTopicIdAndProb  )  [inline]

Definition at line 116 of file InputType.h.

References m_useTopicIdAndProb.

void Moses::InputType::SetWeightSetting ( std::string  settingName  )  [inline]

Definition at line 128 of file InputType.h.

References m_weightSetting.

Moses::InputType::TO_STRING (  ) 


Member Data Documentation

boost::shared_ptr<std::vector<std::string> > Moses::InputType::m_context [protected]

Definition at line 62 of file InputType.h.

Referenced by GetContext(), and SetContext().

SPTR<std::map<size_t const, std::vector<float> > > Moses::InputType::m_coordMap

Definition at line 50 of file InputType.h.

Referenced by GetDocumentId(), and SetDocumentId().

Definition at line 68 of file InputType.h.

Referenced by Moses::DistortionScoreProducer::EmptyHypothesisState(), and InputType().

Definition at line 56 of file InputType.h.

Definition at line 67 of file InputType.h.

std::string Moses::InputType::m_passthrough [protected]

Definition at line 61 of file InputType.h.

Referenced by GetPassthroughInformation(), and SetPassthroughInformation().

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

Definition at line 59 of file InputType.h.

Referenced by GetReorderingConstraint().

long Moses::InputType::m_segId [protected]

Definition at line 58 of file InputType.h.

Definition at line 66 of file InputType.h.

Referenced by InputType().

Definition at line 57 of file InputType.h.

Referenced by GetSpecifiesWeightSetting(), and SetSpecifiesWeightSetting().

std::string Moses::InputType::m_textType [protected]

Definition at line 60 of file InputType.h.

Referenced by GetTextType(), and SetTextType().

long Moses::InputType::m_topicId [protected]

Definition at line 51 of file InputType.h.

Referenced by GetTopicId(), and SetTopicId().

std::vector<std::string> Moses::InputType::m_topicIdAndProb [protected]

Definition at line 53 of file InputType.h.

Referenced by GetTopicIdAndProb(), and SetTopicIdAndProb().

Definition at line 49 of file InputType.h.

Referenced by GetTranslationId(), and SetTranslationId().

Definition at line 54 of file InputType.h.

Referenced by GetUseTopicId(), and SetUseTopicId().

Definition at line 55 of file InputType.h.

Referenced by GetUseTopicIdAndProb(), and SetUseTopicIdAndProb().

std::string Moses::InputType::m_weightSetting [protected]

Definition at line 52 of file InputType.h.

Referenced by GetWeightSetting(), and SetWeightSetting().


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

Generated on Thu Jul 6 00:33:18 2017 for Moses by  doxygen 1.5.9