Tanl Linguistic Pipeline

Parser::EventStream Class Reference
[Dependency Parser]

Creates a stream of Classifier::Event's from an annotated dependency corpus. More...

#include <EventStream.h>

Inheritance diagram for Parser::EventStream:
Tanl::Classifier::EventStream Parser::Iterator< Tanl::Classifier::Event * > Tanl::Iterator< Event * >

List of all members.

Public Member Functions

 EventStream (Tanl::Enumerator< Sentence * > *reader, GlobalInfo *info, int sentenceCutoff=INT_MAX)
 Constructor.
bool hasNext ()
Tanl::Classifier::Eventnext ()
 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
TrainStatestate
 parser state
GlobalInfoinfo
 collected information
int sentenceCutoff
 Max number of sentence to read.
int sentenceCount
 Sentence read so far.

Detailed Description

Creates a stream of Classifier::Event's from an annotated dependency corpus.


Constructor & Destructor Documentation

Parser::EventStream::EventStream ( Tanl::Enumerator< Sentence * > *  reader,
GlobalInfo info,
int  sentenceCutoff = INT_MAX 
) [inline]

Constructor.

Parameters:
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.

Member Function Documentation

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]
Tanl::Classifier::Event * Parser::EventStream::next (  )  [virtual]

Generate the next training event and perform parse action.

Returns:
next event from stream, and perform corresponding 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).

Returns:
the next training event.

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]
Returns:
the feature indicated for splitting the model

References Parser::State::splitFeature, and state.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
 
Copyright © 2005-2011 G. Attardi. Generated on 4 Mar 2011 by doxygen 1.6.1.