DeSR Dependency Parser

Parser::EventStream Class Reference

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

#include <EventStream.h>

Inheritance diagram for Parser::EventStream:

Inheritance graph
Collaboration diagram for Parser::EventStream:

Collaboration graph

List of all members.

Public Member Functions

 EventStream (SentenceReader *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

SentenceReader * reader
 used to read sentences
TrainStatestate
 parser state
GlobalInfo * info
 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.

Definition at line 36 of file EventStream.h.


Constructor & Destructor Documentation

Parser::EventStream::EventStream ( SentenceReader *  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.

Definition at line 46 of file EventStream.h.


Member Function Documentation

bool Parser::EventStream::EoS (  )  [inline]

Tells whether it is the end of a sentence.

Definition at line 73 of file EventStream.h.

References Parser::TrainState::hasNext(), and state.

bool Parser::EventStream::hasNext (  )  [virtual]

Returns:
true if there are other events.

Implements Parser::Iterator< Tanl::Classifier::Event * >.

Definition at line 32 of file EventStream.cpp.

References Parser::TrainState::hasNext(), info, reader, sentenceCount, sentenceCutoff, and state.

Referenced by Parser::MultiSvmParser::train(), and Parser::ApParser::train().

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 * >.

Definition at line 55 of file EventStream.cpp.

References Parser::TrainState::next(), state, and Parser::State::transition().

Referenced by Parser::MultiSvmParser::train(), and Parser::ApParser::train().

std::string& Parser::EventStream::splitFeature (  )  [inline]

Returns:
the feature indicated for splitting the model

Definition at line 80 of file EventStream.h.

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


The documentation for this class was generated from the following files:
 
Copyright © 2005-2007 G. Attardi. Generated on 13 Aug 2009 by doxygen 1.5.7.1.