From 851e389dffdd6996ea32d70defb8906de80b9edc Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 14 Dec 2009 20:35:11 -0500 Subject: few small fixes of alignment tools, add new orthographic similarity feature for word aligner, final naming of directories, libraries in cdec --- src/dict.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/dict.h (limited to 'src/dict.h') diff --git a/src/dict.h b/src/dict.h deleted file mode 100644 index bae9debe..00000000 --- a/src/dict.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef DICT_H_ -#define DICT_H_ - -#include -#include -#include -#include -#include - -#include - -#include "wordid.h" - -class Dict { - typedef std::tr1::unordered_map > Map; - public: - Dict() : b0_("") { words_.reserve(1000); } - inline int max() const { return words_.size(); } - inline WordID Convert(const std::string& word) { - Map::iterator i = d_.find(word); - if (i == d_.end()) { - words_.push_back(word); - d_[word] = words_.size(); - return words_.size(); - } else { - return i->second; - } - } - inline const std::string& Convert(const WordID& id) const { - if (id == 0) return b0_; - assert(id <= words_.size()); - return words_[id-1]; - } - private: - const std::string b0_; - std::vector words_; - Map d_; -}; - -#endif -- cgit v1.2.3