summaryrefslogtreecommitdiff
path: root/extractor/vocabulary.h
blob: 057442697952d5b98270c3cdea0fa413e524a93f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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