mosesdecoder/contrib/other-builds/moses2/FF/FeatureFunctions.h

62 lines
1.4 KiB
C
Raw Normal View History

2015-10-27 19:54:15 +03:00
/*
* FeatureFunctions.h
*
* Created on: 27 Oct 2015
* Author: hieu
*/
#ifndef FEATUREFUNCTIONS_H_
#define FEATUREFUNCTIONS_H_
#include <vector>
2015-10-27 20:35:42 +03:00
#include <string>
2015-11-13 13:40:55 +03:00
#include "../legacy/Parameter.h"
2015-10-27 19:54:15 +03:00
class System;
class FeatureFunction;
class StatefulFeatureFunction;
class PhraseTable;
2015-10-29 03:47:06 +03:00
class Manager;
2015-11-02 17:06:03 +03:00
class MemPool;
2015-10-29 03:47:06 +03:00
class Phrase;
2015-11-03 17:20:10 +03:00
class PhraseImpl;
2015-10-29 03:47:06 +03:00
class TargetPhrase;
class Scores;
2015-10-27 19:54:15 +03:00
class FeatureFunctions {
public:
2015-11-18 14:47:50 +03:00
std::vector<const FeatureFunction*> hasVocabInd;
FeatureFunctions(System &system);
2015-10-27 19:54:15 +03:00
virtual ~FeatureFunctions();
const std::vector<const StatefulFeatureFunction*> &GetStatefulFeatureFunctions() const
{ return m_statefulFeatureFunctions; }
2015-10-27 20:00:38 +03:00
size_t GetNumScores() const
2015-10-27 19:54:15 +03:00
{ return m_ffStartInd; }
2015-10-29 21:15:12 +03:00
void Create();
void Load();
2015-10-27 19:54:15 +03:00
2015-10-29 21:15:12 +03:00
const FeatureFunction &FindFeatureFunction(const std::string &name) const;
2015-10-31 05:45:01 +03:00
const PhraseTable *GetPhraseTablesExcludeUnknownWordPenalty(size_t ptInd);
2015-10-27 20:35:42 +03:00
2015-10-29 03:47:06 +03:00
virtual void
2015-11-02 17:06:03 +03:00
EvaluateInIsolation(MemPool &pool, const System &system,
2015-11-03 17:20:10 +03:00
const Phrase &source, TargetPhrase &targetPhrase) const;
2015-10-29 03:47:06 +03:00
2015-10-27 19:54:15 +03:00
protected:
std::vector<const FeatureFunction*> m_featureFunctions;
std::vector<const StatefulFeatureFunction*> m_statefulFeatureFunctions;
std::vector<const PhraseTable*> m_phraseTables;
System &m_system;
size_t m_ffStartInd;
FeatureFunction *Create(const std::string &line);
};
#endif /* FEATUREFUNCTIONS_H_ */