diff options
Diffstat (limited to 'extractor/phrase.h')
-rw-r--r-- | extractor/phrase.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/extractor/phrase.h b/extractor/phrase.h new file mode 100644 index 00000000..f40a8169 --- /dev/null +++ b/extractor/phrase.h @@ -0,0 +1,41 @@ +#ifndef _PHRASE_H_ +#define _PHRASE_H_ + +#include <iostream> +#include <string> +#include <vector> + +#include "phrase_builder.h" + +using namespace std; + +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; + + //TODO(pauldb): Unit test this method. + int GetNumSymbols() const; + + //TODO(pauldb): Add unit tests. + vector<string> GetWords() const; + + //TODO(pauldb): Add unit tests. + int operator<(const Phrase& other) const; + + friend ostream& operator<<(ostream& os, const Phrase& phrase); + + private: + vector<int> symbols; + vector<int> var_pos; + vector<string> words; +}; + +#endif |