Moses::FactorCollection Class Reference

#include <FactorCollection.h>

Collaboration diagram for Moses::FactorCollection:

Collaboration graph
[legend]

List of all members.

Classes

struct  EqualsFactor
struct  HashFactor

Public Member Functions

 ~FactorCollection ()
const FactorAddFactor (const StringPiece &factorString, bool isNonTerminal=false)
size_t GetNumNonTerminals ()
const FactorGetFactor (const StringPiece &factorString, bool isNonTerminal=false)
const FactorAddFactor (FactorDirection, FactorType, const StringPiece &factorString, bool isNonTerminal=false)
 TO_STRING ()

Static Public Member Functions

static FactorCollectionInstance ()

Friends

class ::System
std::ostream & operator<< (std::ostream &, const FactorCollection &)


Detailed Description

collection of factors

All Factors in moses are accessed and created by a FactorCollection. By enforcing this strict creation processes (ie, forbidding factors from being created on the stack, etc), their memory addresses can be used as keys to uniquely identify them. Only 1 FactorCollection object should be created.

Definition at line 68 of file FactorCollection.h.


Constructor & Destructor Documentation

Moses::FactorCollection::~FactorCollection (  ) 

Definition at line 87 of file FactorCollection.cpp.


Member Function Documentation

const Factor* Moses::FactorCollection::AddFactor ( FactorDirection  ,
FactorType  ,
const StringPiece factorString,
bool  isNonTerminal = false 
) [inline]

Definition at line 123 of file FactorCollection.h.

References AddFactor(), and isNonTerminal().

Here is the call graph for this function:

const Factor * Moses::FactorCollection::AddFactor ( const StringPiece factorString,
bool  isNonTerminal = false 
)

returns a factor with the same direction, factorType and factorString. If a factor already exist in the collection, return the existing factor, if not create a new 1

Definition at line 38 of file FactorCollection.cpp.

References util::Pool::Allocate(), StringPiece::data(), end, Moses::FactorFriend::in, moses_MaxNumNonterminals, StringPiece::size(), and UTIL_THROW_IF2.

Referenced by AddFactor(), Moses::BilingualLM::BilingualLM(), Moses::BilingualLM_NPLM::BilingualLM_NPLM(), Moses::PhraseDictionaryOnDisk::ConvertToMoses(), Moses::LanguageModelSRI::CreateFactors(), Moses::LanguageModelRandLM::CreateFactors(), Moses::LanguageModelMaxEntSRI::CreateFactors(), Moses::LanguageModelIRST::CreateFactors(), Moses::Word::CreateFromString(), Moses::PDTAimp::CreateTargetPhrase(), Moses::Word::CreateUnknownWord(), Moses::LanguageModelDALM::CreateVocabMapping(), Moses::TargetConstituentAdjacencyFeature::EvaluateWhenApplied(), Moses::ExampleLM::ExampleLM(), Moses::GlobalLexicalModel::GlobalLexicalModel(), Moses::Phrase::InitStartEndWord(), Moses::ProbingPT::Load(), Moses::NeuralLMWrapper::Load(), Moses::LanguageModelDALM::Load(), Moses::GenerationDictionary::Load(), Moses::Model1Vocabulary::Load(), Moses::SyntaxOptions::LoadNonTerminals(), Moses::BleuScoreFeature::LoadReferences(), Moses::SoftSourceSyntacticConstraintsFeature::LoadSourceLabelSet(), Moses::SoftSourceSyntacticConstraintsFeature::LoadTargetSourceLeftHandSideJointCountFile(), Moses::PhraseOrientationFeature::LoadWordList(), Moses::MaxSpanFreeNonTermSource::MaxSpanFreeNonTermSource(), Moses::Model1Vocabulary::Model1Vocabulary(), Moses::OxLMMapper::OxLMMapper(), Moses::OxLMParallelMapper::OxLMParallelMapper(), Moses::PhraseOrientationFeature::PhraseOrientationFeature(), Moses::ProcessAndStripXMLTags(), Moses::TranslationOptionCollection::ProcessOneUnknownWord(), Moses::Sentence::ProcessPlaceholders(), Moses::TargetConstituentBoundariesRightAdjacentPhraseProperty::ProcessValue(), Moses::TargetConstituentBoundariesLeftPhraseProperty::ProcessValue(), Moses::NonTermContextProperty::ProcessValue(), Moses::RulePairUnlexicalizedSource::RulePairUnlexicalizedSource(), Moses::SparseHieroReorderingFeature::SparseHieroReorderingFeature(), Moses::TargetBigramFeature::TargetBigramFeature(), Moses::TargetNgramFeature::TargetNgramFeature(), and Moses::VW::VW().

Here is the call graph for this function:

Here is the caller graph for this function:

const Factor * Moses::FactorCollection::GetFactor ( const StringPiece factorString,
bool  isNonTerminal = false 
)

Definition at line 69 of file FactorCollection.cpp.

References end, Moses::FactorFriend::in, and NULL.

size_t Moses::FactorCollection::GetNumNonTerminals (  )  [inline]

Definition at line 116 of file FactorCollection.h.

Referenced by Moses::SoftMatchingFeature::ResizeCache().

Here is the caller graph for this function:

static FactorCollection& Moses::FactorCollection::Instance (  )  [inline, static]

Definition at line 105 of file FactorCollection.h.

Referenced by Moses::BilingualLM::BilingualLM(), Moses::BilingualLM_NPLM::BilingualLM_NPLM(), Moses::ChartCellLabelSet::ChartCellExists(), Moses::PhraseDictionaryOnDisk::ConvertToMoses(), Moses::LanguageModelSRI::CreateFactors(), Moses::LanguageModelMaxEntSRI::CreateFactors(), Moses::Word::CreateFromString(), Moses::PDTAimp::CreateTargetPhrase(), Moses::Word::CreateUnknownWord(), Moses::LanguageModelDALM::CreateVocabMapping(), Moses::TargetConstituentAdjacencyFeature::EvaluateWhenApplied(), Moses::ExampleLM::ExampleLM(), Moses::GlobalLexicalModel::GlobalLexicalModel(), Moses::Phrase::InitStartEndWord(), Moses::ProbingPT::Load(), Moses::LanguageModelRandLM::Load(), Moses::NeuralLMWrapper::Load(), Moses::LanguageModelIRST::Load(), Moses::LanguageModelDALM::Load(), Moses::GenerationDictionary::Load(), Moses::Model1Vocabulary::Load(), Moses::StaticData::LoadData(), Moses::BleuScoreFeature::LoadReferences(), Moses::SoftSourceSyntacticConstraintsFeature::LoadSourceLabelSet(), Moses::SoftSourceSyntacticConstraintsFeature::LoadTargetSourceLeftHandSideJointCountFile(), Moses::PhraseOrientationFeature::LoadWordList(), Moses::MaxSpanFreeNonTermSource::MaxSpanFreeNonTermSource(), Moses::Model1Vocabulary::Model1Vocabulary(), Moses::OxLMMapper::OxLMMapper(), Moses::OxLMParallelMapper::OxLMParallelMapper(), Moses::Syntax::S2T::PChart::PChart(), Moses::PhraseOrientationFeature::PhraseOrientationFeature(), Moses::ProcessAndStripXMLTags(), Moses::TranslationOptionCollection::ProcessOneUnknownWord(), Moses::Sentence::ProcessPlaceholders(), Moses::TargetConstituentBoundariesRightAdjacentPhraseProperty::ProcessValue(), Moses::TargetConstituentBoundariesLeftPhraseProperty::ProcessValue(), Moses::NonTermContextProperty::ProcessValue(), Moses::SoftMatchingFeature::ResizeCache(), Moses::RulePairUnlexicalizedSource::RulePairUnlexicalizedSource(), Moses::DistortionScoreProducer::SetParameter(), Moses::SparseHieroReorderingFeature::SparseHieroReorderingFeature(), Moses::TargetBigramFeature::TargetBigramFeature(), Moses::TargetNgramFeature::TargetNgramFeature(), and Moses::VW::VW().

Here is the caller graph for this function:

Moses::FactorCollection::TO_STRING (  ) 


Friends And Related Function Documentation

friend class ::System [friend]

Definition at line 71 of file FactorCollection.h.

std::ostream& operator<< ( std::ostream &  ,
const FactorCollection  
) [friend]


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

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