summaryrefslogtreecommitdiff
path: root/extractor/translation_table.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-03-10 01:01:01 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-03-10 01:01:01 +0000
commite6181c89ab8f29d8bd0fc6a3a8a359cb50c2304c (patch)
treec05eaae595c711605e6ccb596b8b634756a95c5b /extractor/translation_table.h
parent65a67c6921ee6da0477531224effe38559739455 (diff)
Added comments. Hooray!
Diffstat (limited to 'extractor/translation_table.h')
-rw-r--r--extractor/translation_table.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/extractor/translation_table.h b/extractor/translation_table.h
index a7be26f5..10504d3b 100644
--- a/extractor/translation_table.h
+++ b/extractor/translation_table.h
@@ -18,6 +18,9 @@ typedef boost::hash<pair<int, int> > PairHash;
class Alignment;
class DataArray;
+/**
+ * Bilexical table with conditional probabilities.
+ */
class TranslationTable {
public:
TranslationTable(
@@ -27,9 +30,11 @@ class TranslationTable {
virtual ~TranslationTable();
+ // Returns p(e | f).
virtual double GetTargetGivenSourceScore(const string& source_word,
const string& target_word);
+ // Returns p(f | e).
virtual double GetSourceGivenTargetScore(const string& source_word,
const string& target_word);
@@ -39,7 +44,8 @@ class TranslationTable {
TranslationTable();
private:
- void IncreaseLinksCount(
+ // Increment links count for the given (f, e) word pair.
+ void IncrementLinksCount(
unordered_map<int, int>& source_links_count,
unordered_map<int, int>& target_links_count,
unordered_map<pair<int, int>, int, PairHash>& links_count,