summaryrefslogtreecommitdiff
path: root/extractor/vocabulary.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-01-28 11:56:31 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-01-28 11:56:31 +0000
commit5530575ae0ad939e17f08d6bd49978acea388ab7 (patch)
tree4620a276c1c827d824e285148f4f4a5bf781ebfe /extractor/vocabulary.h
parentce6937f136a38af93d9a5cd9628acc712da95543 (diff)
Initial working commit.
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