2013-06-20 15:50:41 +04:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2013-12-07 04:21:06 +04:00
|
|
|
#include "UnknownWordPenaltyProducer.h"
|
|
|
|
#include "util/exception.hh"
|
2013-06-20 15:50:41 +04:00
|
|
|
|
|
|
|
using namespace std;
|
2013-05-25 03:57:37 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
2013-12-07 04:21:06 +04:00
|
|
|
UnknownWordPenaltyProducer *UnknownWordPenaltyProducer::s_instance = NULL;
|
|
|
|
|
2013-06-20 15:50:41 +04:00
|
|
|
UnknownWordPenaltyProducer::UnknownWordPenaltyProducer(const std::string &line)
|
2013-10-29 22:44:33 +04:00
|
|
|
: StatelessFeatureFunction(1, line)
|
2013-06-26 20:19:09 +04:00
|
|
|
{
|
2013-06-20 15:50:41 +04:00
|
|
|
m_tuneable = false;
|
2013-06-20 16:06:03 +04:00
|
|
|
ReadParameters();
|
2013-12-07 04:21:06 +04:00
|
|
|
|
|
|
|
UTIL_THROW_IF2(s_instance, "Can only have 1 unknown word penalty feature");
|
|
|
|
s_instance = this;
|
2013-06-20 15:50:41 +04:00
|
|
|
}
|
2013-05-25 03:57:37 +04:00
|
|
|
|
2013-07-19 14:35:50 +04:00
|
|
|
std::vector<float> UnknownWordPenaltyProducer::DefaultWeights() const
|
|
|
|
{
|
|
|
|
std::vector<float> ret(1, 1.0f);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-05-25 03:57:37 +04:00
|
|
|
}
|
|
|
|
|