blob: a1426426ae309f0c76435d0d3029311022392203 (
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
|
// -*- c++ -*-
// written by Ulrich Germann
#pragma once
#include "moses/TranslationModel/UG/mm/ug_bitext.h"
#include "util/exception.hh"
#include "boost/format.hpp"
#include "sapt_pscore_base.h"
namespace sapt
{
template<typename Token>
class
PScorePC : public PhraseScorer<Token>
{
public:
PScorePC(std::string const dummy)
{
this->m_index = -1;
this->m_num_feats = 1;
this->m_feature_names.push_back(std::string("phrasecount"));
}
void
operator()(Bitext<Token> const& bt,
PhrasePair<Token>& pp,
std::vector<float> * dest = NULL) const
{
if (!dest) dest = &pp.fvals;
(*dest)[this->m_index] = 1;
}
};
}
|