blob: 6521c438a30454ed64ab30b1974bda3834c2fdf9 (
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
35
36
37
38
39
40
41
42
|
#ifndef _PHRASE_H_
#define _PHRASE_H_
#include <iostream>
#include <string>
#include <vector>
#include "phrase_builder.h"
using namespace std;
namespace extractor {
class Phrase {
public:
friend Phrase PhraseBuilder::Build(const vector<int>& phrase);
int Arity() const;
int GetChunkLen(int index) const;
vector<int> Get() const;
int GetSymbol(int position) const;
int GetNumSymbols() const;
vector<string> GetWords() const;
bool operator<(const Phrase& other) const;
friend ostream& operator<<(ostream& os, const Phrase& phrase);
private:
vector<int> symbols;
vector<int> var_pos;
vector<string> words;
};
} // namespace extractor
#endif
|