This commit is contained in:
Hieu Hoang 2013-06-03 12:33:18 +01:00
parent 3b76143072
commit 21ff6d4831
11 changed files with 36 additions and 42 deletions

View File

@ -89,8 +89,7 @@ void Manager::ProcessSentence()
std::cerr << "sentence specifies weight setting\n";
std::cerr << "calling SetWeightSetting( " << m_source.GetWeightSetting() << ")\n";
StaticData::Instance().SetWeightSetting(m_source.GetWeightSetting());
}
else {
} else {
StaticData::Instance().SetWeightSetting("default");
}
}

View File

@ -113,8 +113,7 @@ int Sentence::Read(std::istream& in,const std::vector<FactorType>& factorOrder)
if (meta.find("weight-setting") != meta.end()) {
this->SetWeightSetting(meta["weight-setting"]);
this->SetSpecifiesWeightSetting(true);
}
else {
} else {
this->SetSpecifiesWeightSetting(false);
}

View File

@ -1150,8 +1150,7 @@ void StaticData::LoadFeatureFunctions()
PhraseDictionary *pt = dynamic_cast<PhraseDictionary*>(ff);
if (pt) {
m_phraseDictionary.push_back(pt);
}
else {
} else {
// load phrase table last. They can depend on other features
ff->Load();
}
@ -1194,7 +1193,8 @@ bool StaticData::CheckWeights() const
return true;
}
void StaticData::ProcessAlternateWeightSettings() {
void StaticData::ProcessAlternateWeightSettings()
{
const vector<string> &weightSpecification = m_parameter->GetParam("alternate-weight-setting");
// get mapping from feature names to feature functions
@ -1250,8 +1250,7 @@ void StaticData::ProcessAlternateWeightSettings() {
if (ffLookUp == nameToFF.end()) {
cerr << "ERROR: alternate weight setting " << currentId << " specifies weight(s) for " << name << " but there is no such feature function" << endl;
hasErrors = true;
}
else {
} else {
m_weightSetting[ currentId ]->Assign( nameToFF[name], weights);
}
}

View File

@ -17,14 +17,11 @@ PhraseDictionaryDynSuffixArray::PhraseDictionaryDynSuffixArray(const std::string
const vector<string> &args = m_args[i];
if (args[0] == "source") {
m_source = args[1];
}
else if (args[0] == "target") {
} else if (args[0] == "target") {
m_target = args[1];
}
else if (args[0] == "alignment") {
} else if (args[0] == "alignment") {
m_alignments = args[1];
}
else {
} else {
//throw "Unknown argument " + args[0];
}
}