diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-03-10 01:01:01 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-03-10 01:01:01 +0000 |
commit | e6181c89ab8f29d8bd0fc6a3a8a359cb50c2304c (patch) | |
tree | c05eaae595c711605e6ccb596b8b634756a95c5b /extractor/phrase.h | |
parent | 65a67c6921ee6da0477531224effe38559739455 (diff) |
Added comments. Hooray!
Diffstat (limited to 'extractor/phrase.h')
-rw-r--r-- | extractor/phrase.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/extractor/phrase.h b/extractor/phrase.h index 6521c438..a8e91e3c 100644 --- a/extractor/phrase.h +++ b/extractor/phrase.h @@ -11,20 +11,30 @@ using namespace std; namespace extractor { +/** + * Structure containing the data for a phrase. + */ class Phrase { public: friend Phrase PhraseBuilder::Build(const vector<int>& phrase); + // Returns the number of nonterminals in the phrase. int Arity() const; + // Returns the number of terminals (length) for the given chunk. (A chunk is a + // contiguous sequence of terminals in the phrase). int GetChunkLen(int index) const; + // Returns the symbols (word ids) marking up the phrase. vector<int> Get() const; + // Returns the symbol located at the given position in the phrase. int GetSymbol(int position) const; + // Returns the number of symbols in the phrase. int GetNumSymbols() const; + // Returns the words making up the phrase. (Nonterminals are stripped out.) vector<string> GetWords() const; bool operator<(const Phrase& other) const; |