Added missing files.

This commit is contained in:
Ulrich Germann 2015-11-11 17:27:53 +00:00
parent f247e26fed
commit 858a509d53
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,44 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#include "OOVHandlingOptions.h"
#include <vector>
#include <iostream>
#include "moses/StaticData.h"
#include "moses/TypeDef.h"
namespace Moses {
OOVHandlingOptions::
OOVHandlingOptions()
{
drop = false;
mark = false;
prefix = "UNK";
suffix = "";
}
bool
OOVHandlingOptions::
init(Parameter const& param)
{
param.SetParameter(drop,"drop-unknown",false);
param.SetParameter(mark,"mark-unknown",false);
param.SetParameter<std::string>(prefix,"unknown-word-prefix","UNK");
param.SetParameter<std::string>(suffix,"unknown-word-suffix","");
return true;
}
#ifdef HAVE_XMLRPC_C
bool
OOVHandlingOptions::
update(std::map<std::string,xmlrpc_c::value>const& param)
{
typedef std::map<std::string, xmlrpc_c::value> params_t;
// params_t::const_iterator si = param.find("xml-input");
// if (si != param.end())
// xml_policy = Scan<XmlInputType>(xmlrpc_c::value_string(si->second));
return true;
}
#endif
}

View File

@ -0,0 +1,27 @@
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#pragma once
#include <string>
#include "moses/Parameter.h"
#include <string>
#include "OptionsBaseClass.h"
namespace Moses
{
struct
OOVHandlingOptions : public OptionsBaseClass
{
bool drop;
bool mark;
std::string prefix;
std::string suffix;
OOVHandlingOptions();
bool init(Parameter const& param);
bool update(std::map<std::string,xmlrpc_c::value>const& param);
};
}