summaryrefslogtreecommitdiff
path: root/extractor/vocabulary.h
blob: c6a8b3e88aee89597fee542b38ce90528a5318b5 (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
#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