Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PhraseLengthFeature.h « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f2514223032f654ec5533e593471d441be2d33ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef moses_PhraseLengthFeature_h
#define moses_PhraseLengthFeature_h

#include <string>
#include <map>

#include "FactorCollection.h"
#include "FeatureFunction.h"
#include "FFState.h"
#include "Word.h"

namespace Moses
{

/** Sets the features for length of source phrase, target phrase, both.
 */
class PhraseLengthFeature : public StatelessFeatureFunction {
public:
	PhraseLengthFeature():
     StatelessFeatureFunction("pl", ScoreProducer::unlimited)
  {}
      
  void Evaluate(const TargetPhrase& cur_phrase,
                ScoreComponentCollection* accumulator) const;

  void EvaluateChart(
    const ChartHypothesis&,
    int /* featureID */,
    ScoreComponentCollection*) const {
		CHECK(0); // feature function not valid in chart decoder
	}

  // basic properties
	std::string GetScoreProducerWeightShortName(unsigned) const { return "pl"; }
	size_t GetNumInputScores() const { return 0; }
};

}

#endif // moses_PhraseLengthFeature_h