From 0a53f7eca74c165b5ce1c238f1999ddf1febea55 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Fri, 1 Feb 2013 16:11:10 +0000 Subject: Second working commit. --- extractor/translation_table.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extractor/translation_table.cc') diff --git a/extractor/translation_table.cc b/extractor/translation_table.cc index 5eb4ffdc..10f1b9ed 100644 --- a/extractor/translation_table.cc +++ b/extractor/translation_table.cc @@ -13,17 +13,17 @@ using namespace tr1; TranslationTable::TranslationTable(shared_ptr source_data_array, shared_ptr target_data_array, - const Alignment& alignment) : + shared_ptr alignment) : source_data_array(source_data_array), target_data_array(target_data_array) { const vector& source_data = source_data_array->GetData(); const vector& target_data = target_data_array->GetData(); unordered_map source_links_count; unordered_map target_links_count; - unordered_map, int, boost::hash > > links_count; + unordered_map, int, PairHash > links_count; for (size_t i = 0; i < source_data_array->GetNumSentences(); ++i) { - vector > links = alignment.GetLinks(i); + const vector >& links = alignment->GetLinks(i); int source_start = source_data_array->GetSentenceStart(i); int next_source_start = source_data_array->GetSentenceStart(i + 1); int target_start = target_data_array->GetSentenceStart(i); @@ -58,7 +58,7 @@ TranslationTable::TranslationTable(shared_ptr source_data_array, } } -double TranslationTable::GetEgivenFScore( +double TranslationTable::GetTargetGivenSourceScore( const string& source_word, const string& target_word) { if (!source_data_array->HasWord(source_word) || !target_data_array->HasWord(target_word)) { @@ -70,7 +70,7 @@ double TranslationTable::GetEgivenFScore( return translation_probabilities[make_pair(source_id, target_id)].first; } -double TranslationTable::GetFgivenEScore( +double TranslationTable::GetSourceGivenTargetScore( const string& source_word, const string& target_word) { if (!source_data_array->HasWord(source_word) || !target_data_array->HasWord(target_word) == 0) { -- cgit v1.2.3