summaryrefslogtreecommitdiff
path: root/gi/pyp-topics/src/contexts_corpus.hh
diff options
context:
space:
mode:
Diffstat (limited to 'gi/pyp-topics/src/contexts_corpus.hh')
-rw-r--r--gi/pyp-topics/src/contexts_corpus.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/gi/pyp-topics/src/contexts_corpus.hh b/gi/pyp-topics/src/contexts_corpus.hh
index 891e3a6b..66b71783 100644
--- a/gi/pyp-topics/src/contexts_corpus.hh
+++ b/gi/pyp-topics/src/contexts_corpus.hh
@@ -4,6 +4,7 @@
#include <vector>
#include <string>
#include <map>
+#include <tr1/unordered_map>
#include <boost/ptr_container/ptr_vector.hpp>
@@ -66,6 +67,11 @@ public:
return res;
}
+ virtual int context_count(const WordID& id) const {
+ return m_context_counts.find(id)->second;
+ }
+
+
const std::string& key(const int& i) const {
return m_keys.at(i);
}
@@ -74,6 +80,7 @@ private:
TermBackoffPtr m_backoff;
Dict m_dict;
std::vector<std::string> m_keys;
+ std::tr1::unordered_map<int,int> m_context_counts;
};
#endif // _CONTEXTS_CORPUS_HH