mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
enum StatelessFeatureType
This commit is contained in:
parent
26a4aa8d18
commit
a311f07d1f
@ -181,16 +181,6 @@ StatelessFeatureFunction::StatelessFeatureFunction(const std::string& descriptio
|
||||
m_statelessFFs.push_back(this);
|
||||
}
|
||||
|
||||
bool StatelessFeatureFunction::IsStateless() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StatelessFeatureFunction::ComputeValueInTranslationOption() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
StatefulFeatureFunction::StatefulFeatureFunction(const std::string& description, const std::string &line)
|
||||
: FeatureFunction(description, line)
|
||||
{
|
||||
|
@ -158,15 +158,22 @@ public:
|
||||
virtual void EvaluateChart(const ChartBasedFeatureContext& context,
|
||||
ScoreComponentCollection* accumulator) const = 0;
|
||||
|
||||
virtual StatelessFeatureType GetStatelessFeatureType() const
|
||||
{ return CacheableInPhraseTable; }
|
||||
|
||||
//If true, then the feature is evaluated before search begins, and stored in
|
||||
//the TranslationOptionCollection.
|
||||
virtual bool ComputeValueInTranslationOption() const;
|
||||
virtual bool ComputeValueInTranslationOption() const
|
||||
{ return false; }
|
||||
|
||||
//!If true, the feature is stored in the ttable, so gets copied into the
|
||||
//TargetPhrase and does not need cached in the TranslationOption
|
||||
virtual bool ComputeValueInTranslationTable() const {return false;}
|
||||
virtual bool ComputeValueInTranslationTable() const
|
||||
{ return false;}
|
||||
|
||||
bool IsStateless() const
|
||||
{ return true; }
|
||||
|
||||
bool IsStateless() const;
|
||||
};
|
||||
|
||||
/** base class for all stateful feature functions.
|
||||
|
@ -175,6 +175,13 @@ enum FormatType
|
||||
,HieroFormat
|
||||
};
|
||||
|
||||
enum StatelessFeatureType
|
||||
{
|
||||
CacheableInPhraseTable // simplest. eg. phrase table scores. word penalty, phrase penalty.
|
||||
,DependsOnSource // can't be pre-computed during training, but can't be computed before search.eg. source bag-of-word features
|
||||
,NotCacheable // can't be pre-computed. Depends on segmentation during search. eg. span-length feature
|
||||
};
|
||||
|
||||
// typedef
|
||||
typedef size_t FactorType;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user