diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-20 00:49:10 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-20 00:49:10 +0400 |
commit | 8987fed667c8c7cedfb714b28a061fb7b8030d6c (patch) | |
tree | 153d8406fcf4b558e952fc00b7c9a1b2403c9d49 /mert/Vocabulary.h | |
parent | 1678ee37695a94e237b1ca1d07a22373a0f3a0cb (diff) |
Add thread unsafe Singleton class.
- Add Vocabulary factory and the unit test.
- Remove Scorer::ClearVocabulary().
Diffstat (limited to 'mert/Vocabulary.h')
-rw-r--r-- | mert/Vocabulary.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mert/Vocabulary.h b/mert/Vocabulary.h index f9493823d..12c8c1727 100644 --- a/mert/Vocabulary.h +++ b/mert/Vocabulary.h @@ -64,6 +64,16 @@ class Vocabulary { std::map<std::string, int> m_vocab; }; +class VocabularyFactory { + public: + static Vocabulary* GetVocabulary(); + static void SetVocabulary(Vocabulary* vocab); + + private: + VocabularyFactory() {} + virtual ~VocabularyFactory() {} +}; + } // namespace mert #endif // MERT_VOCABULARY_H_ |