blob: ed55e5e4c7b5ebf9c7668118299c2e75c63cbce2 (
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();
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
|