summaryrefslogtreecommitdiff
path: root/extractor/translation_table.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
commit252fb164c208ec8f3005f8a652eb3b48c0644e3d (patch)
tree7199cb668e77ef89c7bcccb37d70554e3b52c2a5 /extractor/translation_table.h
parent4ab84a0be28fdb6c0c421fe5ba5e09cfa298f2d1 (diff)
Second working commit.
Diffstat (limited to 'extractor/translation_table.h')
-rw-r--r--extractor/translation_table.h18
1 files changed, 11 insertions, 7 deletions
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<pair<int, int> > PairHash;
+
class TranslationTable {
public:
TranslationTable(
shared_ptr<DataArray> source_data_array,
shared_ptr<DataArray> target_data_array,
- const Alignment& alignment);
+ shared_ptr<Alignment> 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<DataArray> source_data_array;
- shared_ptr<DataArray> target_data_array;
- unordered_map<pair<int, int>, pair<double, double>,
- boost::hash<pair<int, int> > > translation_probabilities;
+ shared_ptr<DataArray> source_data_array;
+ shared_ptr<DataArray> target_data_array;
+ unordered_map<pair<int, int>, pair<double, double>, PairHash>
+ translation_probabilities;
};
#endif