re-apply changes unrelated to setting reference translations

This commit is contained in:
Eva Hasler 2011-10-20 14:32:05 +01:00
parent b263f14f63
commit eebfd61e48
3 changed files with 6 additions and 6 deletions

View File

@ -70,14 +70,14 @@ namespace Mira {
: m_manager(NULL) {
// force initialisation of the phrase dictionary (TODO: why?)
const StaticData &staticData = StaticData::Instance();
m_sentence = new Sentence(Input);
/*m_sentence = new Sentence(Input);
stringstream in("Initialising decoder..\n");
const std::vector<FactorType> &inputFactorOrder = staticData.GetInputFactorOrder();
m_sentence->Read(in,inputFactorOrder);
m_sentence->Read(in,inputFactorOrder);*/
const TranslationSystem& system = staticData.GetTranslationSystem(TranslationSystem::DEFAULT);
m_manager = new Manager(*m_sentence, staticData.GetSearchAlgorithm(), &system);
m_manager->ProcessSentence();
/*m_manager = new Manager(*m_sentence, staticData.GetSearchAlgorithm(), &system);
m_manager->ProcessSentence();*/
// Add the bleu feature
m_bleuScoreFeature = new BleuScoreFeature(scaleByInputLength, historySmoothing);

View File

@ -83,6 +83,7 @@ void BleuScoreFeature::PrintHistory(std::ostream& out) const {
void BleuScoreFeature::LoadReferences(const std::vector< std::vector< std::string > >& refs)
{
cerr << "BleuScoreFeature: loading reference sentences.. " << endl;
m_refs.clear();
FactorCollection& fc = FactorCollection::Instance();
for (size_t file_id = 0; file_id < refs.size(); file_id++) {

View File

@ -1298,7 +1298,7 @@ bool StaticData::LoadDecodeGraphs()
bool StaticData::LoadReferences()
{
vector<string> bleuWeightStr = m_parameter->GetParam("weight-b");
vector<string> bleuWeightStr = m_parameter->GetParam("weight-bl");
vector<string> referenceFiles = m_parameter->GetParam("references");
if ((!referenceFiles.size() && bleuWeightStr.size()) || (referenceFiles.size() && !bleuWeightStr.size())) {
UserMessage::Add("You cannot use the bleu feature without references, and vice-versa");
@ -1338,7 +1338,6 @@ bool StaticData::LoadReferences()
}
//Set the references in the bleu feature
m_bleuScoreFeature->LoadReferences(references);
m_bleuScoreFeature->SetCurrentReference(0); //TODO: Temporary, for testing
return true;
}