#include <InputType.h>
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 ¤t) 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 ¤t) 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 Word & | GetWord (size_t pos) const =0 |
return substring at a particular position. Only valid for Sentence class. TODO - get rid of this fn | |
const ReorderingConstraint & | GetReorderingConstraint () const |
Returns the reordering constraints. | |
virtual const NonTerminalSet & | GetLabelSet (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 |
Definition at line 45 of file InputType.h.
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.
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().
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().
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] |
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().
virtual const NonTerminalSet& Moses::InputType::GetLabelSet | ( | size_t | startPos, | |
size_t | endPos | |||
) | const [pure virtual] |
Implemented in Moses::ConfusionNet, Moses::Sentence, and Moses::TreeInput.
std::string Moses::InputType::GetPassthroughInformation | ( | ) | const [inline] |
Definition at line 137 of file InputType.h.
References m_passthrough.
Referenced by Moses::Manager::OutputPassthroughInformation().
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().
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().
bool Moses::InputType::GetSpecifiesWeightSetting | ( | ) | const [inline] |
Definition at line 125 of file InputType.h.
References m_specifiesWeightSetting.
Referenced by Moses::Manager::Decode().
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().
std::string Moses::InputType::GetTextType | ( | ) | const [inline] |
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().
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().
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().
virtual InputTypeEnum Moses::InputType::GetType | ( | ) | const [pure virtual] |
Implemented in Moses::ConfusionNet, Moses::ForestInput, Moses::Sentence, Moses::TabbedSentence, Moses::TreeInput, and Moses::WordLattice.
Referenced by Moses::InputFeature::EvaluateWithSourceContext(), Moses::VWFeatureSourceExternalFeatures::InitializeForInput(), Moses::VW::InitializeForInput(), Moses::DecodeStepTranslation::ProcessInitialTranslation(), Moses::DecodeStepTranslation::ProcessInitialTransLEGACY(), and Moses::SearchNormal::ProcessOneHypothesis().
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().
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().
std::string Moses::InputType::GetWeightSetting | ( | ) | const [inline] |
Definition at line 131 of file InputType.h.
References m_weightSetting.
Referenced by Moses::Manager::Decode().
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::ChartCellCollectionBase::ChartCellCollectionBase(), Moses::NieceTerminal::ContainTerm(), Moses::ChartParser::Create(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::WordTranslationFeature::EvaluateWithSourceContext(), Moses::VWFeatureContext::GetSourceWord(), Moses::VWFeatureSource::GetWord(), and Moses::PhraseDictionaryFuzzyMatch::InitializeForInput().
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().
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().
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().
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().
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<<().
virtual int Moses::InputType::Read | ( | std::istream & | in | ) | [pure virtual] |
populate this InputType with data from in stream
Implemented in Moses::ConfusionNet, Moses::ForestInput, Moses::Sentence, Moses::TabbedSentence, Moses::TreeInput, and Moses::WordLattice.
virtual void Moses::InputType::SetContext | ( | boost::shared_ptr< std::vector< std::string > > const & | ctx | ) | [inline, virtual] |
void Moses::InputType::SetDocumentId | ( | long | documentId | ) | [inline] |
void Moses::InputType::SetPassthroughInformation | ( | std::string & | passthrough | ) | [inline] |
void Moses::InputType::SetSpecifiesWeightSetting | ( | bool | specifiesWeightSetting | ) | [inline] |
void Moses::InputType::SetTextType | ( | std::string | type | ) | [inline] |
void Moses::InputType::SetTopicId | ( | long | topicId | ) | [inline] |
void Moses::InputType::SetTopicIdAndProb | ( | std::vector< std::string > | topicIdAndProb | ) | [inline] |
void Moses::InputType::SetTranslationId | ( | long | translationId | ) | [inline] |
Definition at line 86 of file InputType.h.
References m_translationId.
Referenced by Moses::WordLattice::Read().
void Moses::InputType::SetUseTopicId | ( | bool | useTopicId | ) | [inline] |
void Moses::InputType::SetUseTopicIdAndProb | ( | bool | useTopicIdAndProb | ) | [inline] |
void Moses::InputType::SetWeightSetting | ( | std::string | settingName | ) | [inline] |
Moses::InputType::TO_STRING | ( | ) |
boost::shared_ptr<std::vector<std::string> > Moses::InputType::m_context [protected] |
SPTR<std::map<size_t const, std::vector<float> > > Moses::InputType::m_coordMap |
Definition at line 72 of file InputType.h.
Referenced by Moses::PhraseDistanceFeature::EvaluateWithSourceContext(), and Moses::ProcessAndStripXMLTags().
long Moses::InputType::m_documentId [protected] |
Definition at line 68 of file InputType.h.
Referenced by Moses::DistortionScoreProducer::EmptyHypothesisState(), and InputType().
bool Moses::InputType::m_hasMetaData [protected] |
Definition at line 56 of file InputType.h.
std::string Moses::InputType::m_initialTargetPhrase |
Definition at line 67 of file InputType.h.
AllOptions::ptr Moses::InputType::m_options [protected] |
Definition at line 48 of file InputType.h.
Referenced by Moses::TreeInput::AddChartLabel(), Moses::Sentence::GetXmlChartTranslationOptions(), Moses::WordLattice::InitializeFromPCNDataType(), options(), Moses::Sentence::ProcessPlaceholders(), Moses::TreeInput::Read(), Moses::ForestInput::Read(), Moses::ConfusionNet::ReadFormat0(), and Moses::ConfusionNet::ReadFormat1().
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.
std::vector<bool> Moses::InputType::m_sourceCompleted |
bool Moses::InputType::m_specifiesWeightSetting [protected] |
Definition at line 57 of file InputType.h.
Referenced by GetSpecifiesWeightSetting(), and SetSpecifiesWeightSetting().
std::string Moses::InputType::m_textType [protected] |
long Moses::InputType::m_topicId [protected] |
std::vector<std::string> Moses::InputType::m_topicIdAndProb [protected] |
Definition at line 53 of file InputType.h.
Referenced by GetTopicIdAndProb(), and SetTopicIdAndProb().
long Moses::InputType::m_translationId [protected] |
Definition at line 49 of file InputType.h.
Referenced by GetTranslationId(), and SetTranslationId().
bool Moses::InputType::m_useTopicId [protected] |
bool Moses::InputType::m_useTopicIdAndProb [protected] |
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().