diff options
Diffstat (limited to 'extractor/vocabulary.h')
-rw-r--r-- | extractor/vocabulary.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h new file mode 100644 index 00000000..c6a8b3e8 --- /dev/null +++ b/extractor/vocabulary.h @@ -0,0 +1,27 @@ +#ifndef _VOCABULARY_H_ +#define _VOCABULARY_H_ + +#include <string> +#include <unordered_map> +#include <vector> + +using namespace std; + +class Vocabulary { + public: + virtual ~Vocabulary(); + + virtual int GetTerminalIndex(const string& word); + + int GetNonterminalIndex(int position); + + bool IsTerminal(int symbol); + + virtual string GetTerminalValue(int symbol); + + private: + unordered_map<string, int> dictionary; + vector<string> words; +}; + +#endif |