create-ini.cpp

This commit is contained in:
Hieu Hoang 2013-02-08 17:57:22 +00:00
parent e4876599d2
commit 54f7c45f45
6 changed files with 12 additions and 15 deletions

View File

@ -8,8 +8,6 @@ exe queryLexicalTable : queryLexicalTable.cpp ../moses//moses ;
exe reuse-weights : reuse-weights.cpp ../moses//moses ;
exe create-ini : create-ini.cpp ../moses//moses ;
local with-cmph = [ option.get "with-cmph" ] ;
if $(with-cmph) {
exe processPhraseTableMin : processPhraseTableMin.cpp ../moses//moses ;
@ -23,4 +21,4 @@ else {
alias programsMin ;
}
alias programs : processPhraseTable processLexicalTable queryPhraseTable queryLexicalTable programsMin reuse-weights create-ini ;
alias programs : processPhraseTable processLexicalTable queryPhraseTable queryLexicalTable programsMin reuse-weights create-ini//create-ini ;

3
misc/create-ini/Jamfile Normal file
View File

@ -0,0 +1,3 @@
exe create-ini : FF.cpp LM.cpp PT.cpp RO.cpp Main.cpp ;

View File

@ -7,8 +7,7 @@ void PT::Output(std::ostream &out) const
out << name << index
<< " implementation=" << 0
<< " num-features=" << numFeatures
<< " path=" << path << " ";
<< " path=" << path;
out << " input-factor=";
Output(out, inFactor);

View File

@ -12,7 +12,7 @@ class RO : public FF
void Output(std::ostream &out) const
{
out << name << index << " "
out << name << index
<< " path=" << path
<< std::endl;
}

View File

@ -759,13 +759,6 @@ bool Parameter::Validate()
}
}
// required parameters
if (m_setting["ttable-file"].size() == 0) {
UserMessage::Add("No phrase translation table (ttable-file)");
noErrorFlag = false;
}
if (m_setting["lmodel-dub"].size() > 0) {
if (m_setting["lmodel-file"].size() != m_setting["lmodel-dub"].size()) {
stringstream errorMsg("");

View File

@ -533,7 +533,11 @@ bool StaticData::LoadData(Parameter *parameter)
const vector<string> &features = m_parameter->GetParam("feature");
for (size_t i = 0; i < features.size(); ++i) {
const string &line = features[i];
const string &line = Trim(features[i]);
cerr << "line=" << line << endl;
if (line.empty())
continue;
vector<string> toks = Tokenize(line);
const string &feature = toks[0];
@ -650,7 +654,7 @@ bool StaticData::LoadData(Parameter *parameter)
}
#endif
else {
UserMessage::Add("Unknown feature function");
UserMessage::Add("Unknown feature function:" + feature);
return false;
}