From 252fb164c208ec8f3005f8a652eb3b48c0644e3d 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.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'extractor/translation_table.h') diff --git a/extractor/translation_table.h b/extractor/translation_table.h index 6004eca0..acf94af7 100644 --- a/extractor/translation_table.h +++ b/extractor/translation_table.h @@ -15,24 +15,28 @@ namespace fs = boost::filesystem; class Alignment; class DataArray; +typedef boost::hash > PairHash; + class TranslationTable { public: TranslationTable( shared_ptr source_data_array, shared_ptr target_data_array, - const Alignment& alignment); + shared_ptr alignment); - double GetEgivenFScore(const string& source_word, const string& target_word); + double GetTargetGivenSourceScore(const string& source_word, + const string& target_word); - double GetFgivenEScore(const string& source_word, const string& target_word); + double GetSourceGivenTargetScore(const string& source_word, + const string& target_word); void WriteBinary(const fs::path& filepath) const; private: - shared_ptr source_data_array; - shared_ptr target_data_array; - unordered_map, pair, - boost::hash > > translation_probabilities; + shared_ptr source_data_array; + shared_ptr target_data_array; + unordered_map, pair, PairHash> + translation_probabilities; }; #endif -- cgit v1.2.3