summaryrefslogtreecommitdiff
path: root/extractor/grammar.h
blob: fed41b168f5d2a8a22fd0abbaad86bb73143aa6f (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
29
30
31
32
33
34
#ifndef _GRAMMAR_H_
#define _GRAMMAR_H_

#include <iostream>
#include <string>
#include <vector>

using namespace std;

namespace extractor {

class Rule;

/**
 * Grammar class wrapping the set of rules to be extracted.
 */
class Grammar {
 public:
  Grammar(const vector<Rule>& rules, const vector<string>& feature_names);

  vector<Rule> GetRules() const;

  vector<string> GetFeatureNames() const;

  friend ostream& operator<<(ostream& os, const Grammar& grammar);

 private:
  vector<Rule> rules;
  vector<string> feature_names;
};

} // namespace extractor

#endif