mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
throw exception if unknown argument
This commit is contained in:
parent
711bdf1b71
commit
e0746cd525
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.162355801">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.162355801" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -76,6 +74,7 @@
|
||||
<listOptionValue builtIn="false" value="boost_system-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="boost_filesystem-mt"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.128214028" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?>
|
||||
|
||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.461114338">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.461114338" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
@ -74,6 +72,7 @@
|
||||
<listOptionValue builtIn="false" value="boost_thread-mt"/>
|
||||
<listOptionValue builtIn="false" value="lm"/>
|
||||
<listOptionValue builtIn="false" value="util"/>
|
||||
<listOptionValue builtIn="false" value="rt"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.userobjs.1542590830" name="Other objects" superClass="gnu.cpp.link.option.userobjs" valueType="userObjs">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc}/../../boost/lib64/libboost_system-mt.a""/>
|
||||
|
@ -33,7 +33,6 @@ namespace Moses
|
||||
|
||||
/** Singleton collection of all AlignmentInfo objects.
|
||||
* Used as a cache of all alignment info to save space.
|
||||
* @todo Check whether this needs locking in threaded environment
|
||||
*/
|
||||
class AlignmentInfoCollection
|
||||
{
|
||||
|
@ -32,8 +32,7 @@ namespace Moses
|
||||
{
|
||||
|
||||
/**
|
||||
* A feature on the decoding path (Generation or Translation)
|
||||
* @todo don't quite understand what this is
|
||||
* Baseclass for phrase-table or generation table feature function
|
||||
**/
|
||||
class DecodeFeature : public StatelessFeatureFunction {
|
||||
|
||||
|
@ -8,8 +8,6 @@
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
/** @todo What is the difference between this and the classes in FeatureFunction?
|
||||
*/
|
||||
class FFState
|
||||
{
|
||||
public:
|
||||
|
@ -17,9 +17,8 @@ GlobalLexicalModel::GlobalLexicalModel(const std::string &line)
|
||||
string filePath;
|
||||
vector<FactorType> inputFactors, outputFactors;
|
||||
|
||||
vector<string> toks = Tokenize(line);
|
||||
for (size_t i = 0; i < toks.size(); ++i) {
|
||||
vector<string> args = Tokenize(toks[i], "=");
|
||||
for (size_t i = 0; i < m_args.size(); ++i) {
|
||||
const vector<string> &args = m_args[i];
|
||||
|
||||
if (args[0] == "file") {
|
||||
CHECK(args.size() == 2);
|
||||
@ -31,6 +30,9 @@ GlobalLexicalModel::GlobalLexicalModel(const std::string &line)
|
||||
else if (args[0] == "outputFactors") {
|
||||
outputFactors = Tokenize<FactorType>(args[1],",");
|
||||
}
|
||||
else {
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
// load model
|
||||
|
@ -61,8 +61,7 @@ LanguageModelIRST::LanguageModelIRST(const std::string &line)
|
||||
filePath = args[1];
|
||||
}
|
||||
else {
|
||||
UserMessage::Add("Unknown argument " + args[0]);
|
||||
abort();
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,8 +362,7 @@ LanguageModel *ConstructKenLM(const std::string &description, const std::string
|
||||
lazy = Scan<bool>(args[1]);
|
||||
}
|
||||
else {
|
||||
UserMessage::Add("Unknown argument " + args[0]);
|
||||
abort();
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,9 @@ LexicalReordering::LexicalReordering(const std::string &line)
|
||||
else if (args[0] == "path") {
|
||||
filePath = args[1];
|
||||
}
|
||||
else {
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
switch(m_configuration->GetCondition()) {
|
||||
|
@ -308,13 +308,6 @@ Scores LexicalReorderingTableTree::auxFindScoreForContext(const Candidates& cand
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void LexicalReorderingTableTree::DbgDump(std::ostream* pout){
|
||||
std::ostream& out = *pout;
|
||||
//TODO!
|
||||
}
|
||||
*/
|
||||
|
||||
void LexicalReorderingTableTree::InitializeForInput(const InputType& input)
|
||||
{
|
||||
ClearCache();
|
||||
|
@ -28,7 +28,9 @@ PhraseBoundaryFeature::PhraseBoundaryFeature(const std::string &line)
|
||||
else if (args[0] == "target") {
|
||||
m_targetFactors = Tokenize<FactorType>(args[1], ",");
|
||||
}
|
||||
|
||||
else {
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,7 @@ m_unrestricted(true)
|
||||
filename = args[1];
|
||||
}
|
||||
else {
|
||||
UserMessage::Add("Unknown argument " + args[0]);
|
||||
abort();
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,9 @@ m_unrestricted(true)
|
||||
else if (args[0] == "path") {
|
||||
filename = args[1];
|
||||
}
|
||||
|
||||
else {
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
// load word list for restricted feature set
|
||||
|
@ -82,8 +82,7 @@ PhraseDictionaryFeature::PhraseDictionaryFeature(const std::string &line)
|
||||
m_alignmentsFile = args[1];
|
||||
}
|
||||
else {
|
||||
UserMessage::Add("Unknown argument " + args[0]);
|
||||
abort();
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
} // for (size_t i = 0; i < toks.size(); ++i) {
|
||||
|
||||
|
@ -63,6 +63,9 @@ WordTranslationFeature::WordTranslationFeature(const std::string &line)
|
||||
else if (args[0] == "target-path") {
|
||||
filenameTarget = args[1];
|
||||
}
|
||||
else {
|
||||
throw "Unknown argument " + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (m_simple == 1) std::cerr << "using simple word translations.. ";
|
||||
|
Loading…
Reference in New Issue
Block a user