Tanl Linguistic Pipeline |
Creates a stream of Classifier::Event's from an annotated dependency corpus. More...
#include <EventStream.h>
Public Member Functions | |
EventStream (Tanl::Enumerator< Sentence * > *reader, GlobalInfo *info, int sentenceCutoff=INT_MAX) | |
Constructor. | |
bool | hasNext () |
Tanl::Classifier::Event * | next () |
Generate the next training event and perform parse action. | |
void | reset () |
Restart. | |
bool | EoS () |
Tells whether it is the end of a sentence. | |
std::string & | splitFeature () |
Public Attributes | |
Tanl::Enumerator< Sentence * > * | reader |
used to read sentences | |
TrainState * | state |
parser state | |
GlobalInfo * | info |
collected information | |
int | sentenceCutoff |
Max number of sentence to read. | |
int | sentenceCount |
Sentence read so far. |
Creates a stream of Classifier::Event's from an annotated dependency corpus.
Parser::EventStream::EventStream | ( | Tanl::Enumerator< Sentence * > * | reader, | |
GlobalInfo * | info, | |||
int | sentenceCutoff = INT_MAX | |||
) | [inline] |
Constructor.
reader | the SentenceReader for a Dependency Grammar Corpus. | |
info | where to store information collected from sentences. | |
sentenceCutoff | max number of sentences to read. Default INT_MAX. |
bool Parser::EventStream::EoS | ( | ) | [inline] |
Tells whether it is the end of a sentence.
References Parser::TrainState::hasNext(), and state.
bool Parser::EventStream::hasNext | ( | ) | [virtual] |
Implements Parser::Iterator< Tanl::Classifier::Event * >.
References Tanl::Enumerator< T >::Current(), Parser::TrainState::hasNext(), info, Tanl::Enumerator< T >::MoveNext(), reader, sentenceCount, sentenceCutoff, and state.
Referenced by Parser::MlpModel::collectEvents(), Parser::MultiSvmParser::train(), and Parser::ApParser::train().
Tanl::Classifier::Event * Parser::EventStream::next | ( | ) | [virtual] |
Generate the next training event and perform parse action.
The event outcome is the next action from actions, the context is generated from the past tokens (on the stack) and later tokens in the sentence (from input).
Implements Parser::Iterator< Tanl::Classifier::Event * >.
References Parser::TrainState::next(), state, and Parser::State::transition().
Referenced by Parser::MlpModel::collectEvents(), Parser::MultiSvmParser::train(), and Parser::ApParser::train().
std::string& Parser::EventStream::splitFeature | ( | ) | [inline] |
References Parser::State::splitFeature, and state.