summaryrefslogtreecommitdiff
path: root/extractor/vocabulary.h
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/vocabulary.h')
-rw-r--r--extractor/vocabulary.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h
new file mode 100644
index 00000000..05744269
--- /dev/null
+++ b/extractor/vocabulary.h
@@ -0,0 +1,28 @@
+#ifndef _VOCABULARY_H_
+#define _VOCABULARY_H_
+
+#include <string>
+#include <tr1/unordered_map>
+#include <vector>
+
+using namespace std;
+using namespace tr1;
+
+class Vocabulary {
+ public:
+ virtual ~Vocabulary();
+
+ 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