mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
Added missing files.
This commit is contained in:
parent
f247e26fed
commit
858a509d53
44
moses/parameters/OOVHandlingOptions.cpp
Normal file
44
moses/parameters/OOVHandlingOptions.cpp
Normal 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
|
||||
|
||||
}
|
27
moses/parameters/OOVHandlingOptions.h
Normal file
27
moses/parameters/OOVHandlingOptions.h
Normal 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);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user