summaryrefslogtreecommitdiff
path: root/src/freqdict.h
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2009-12-06 22:25:25 -0500
committerChris Dyer <redpony@gmail.com>2009-12-06 22:25:25 -0500
commit2a18010e255810cc2b5bcbe688f3db8eabda23ca (patch)
treee310286257e5445072303dcca03acb85a865c26a /src/freqdict.h
parent59ea352f3dcf3bf58969f404615fed4ff6b931f7 (diff)
add compound splitting logic and features (Dyer 2008, NAACL)
Diffstat (limited to 'src/freqdict.h')
-rw-r--r--src/freqdict.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/freqdict.h b/src/freqdict.h
index c9bb4c42..9acf0c33 100644
--- a/src/freqdict.h
+++ b/src/freqdict.h
@@ -3,17 +3,18 @@
#include <map>
#include <string>
+#include "wordid.h"
class FreqDict {
public:
- void load(const std::string& fname);
- float frequency(const std::string& word) const {
- std::map<std::string,float>::const_iterator i = counts_.find(word);
+ void Load(const std::string& fname);
+ float LookUp(const WordID& word) const {
+ std::map<WordID,float>::const_iterator i = counts_.find(word);
if (i == counts_.end()) return 0;
return i->second;
}
private:
- std::map<std::string, float> counts_;
+ std::map<WordID, float> counts_;
};
#endif