DeSR Dependency Parser

Parser::Parser Class Reference

Base class for parsers. More...

#include <Parser.h>

Inheritance diagram for Parser::Parser:

Inheritance graph
Collaboration diagram for Parser::Parser:

Collaboration graph

List of all members.

Public Member Functions

 Parser (WordIndex &predIndex)
virtual void train (SentenceReader *sentenceReader, char const *modelFile)=0
 Train statistical model using sentences obtained through a sentenceReader, and save the generated model to modelFile.
virtual Sentence * parse (Sentence *sentence)=0
 Parse the given Sentence sentence.
virtual void parse (SentenceReader *sentenceReader, std::ostream &os=std::cout)
 Parse all sentences extracted by sentenceReader, sending output to os.
virtual void revise (SentenceReader *sentenceReader, char const *actionFile=0)
 Produce a revision of a document parses, using either a model or an action file.
virtual void showEval (int tokenCount, int las, int uas, int sentCount)
 Print accuracy estimates.
void writeHeader (std::ostream &os)
 Write model header to stream.
Enumerator< Sentence * > * pipe (Enumerator< std::vector< Token * > * > &tce)
 IPipe interface.
Enumerator< Sentence * > * pipe (Enumerator< Sentence * > &tce)
 Alternative pipeline interface, that allows connecting directly to a SentenceReader.

Static Public Member Functions

static Parsercreate (char const *modelFile=0)
 Create a Parser based on configuration and data in file modelFile.
static bool readHeader (std::istream &is)
 Read model header from stream.

Public Attributes

WordIndexpredIndex
GlobalInfo info

Static Public Attributes

static IXE::conf< int > featureCutoff
 Drop features which occur less than this number of times.
static IXE::conf< bool > verbose
 Control output.


Detailed Description

Base class for parsers.

Definition at line 72 of file Parser.h.


Member Function Documentation

virtual Sentence* Parser::Parser::parse ( Sentence *  sentence  )  [pure virtual]

Parse the given Sentence sentence.

Returns:
a newly allocated
See also:
Sentence.

Implemented in Parser::ApParser, Parser::MeParser, Parser::MlParser, Parser::MultiSvmParser, and Parser::SvmParser.

Enumerator< Sentence * > * Parser::Parser::pipe ( Enumerator< std::vector< Token * > * > &  tce  ) 

IPipe interface.

Returns:
an Enumerator connected in pipeline to
Parameters:
tce. 

Definition at line 97 of file Parser.cpp.

static bool Parser::Parser::readHeader ( std::istream &  is  )  [static]

Read model header from stream.

Parameters:
is. 
Returns:
true if successful.

Referenced by create().

virtual void Parser::Parser::revise ( SentenceReader *  sentenceReader,
char const *  actionFile = 0 
) [inline, virtual]

Produce a revision of a document parses, using either a model or an action file.

If an actionFile is provided, it must contain a list of actions, one per line, to apply to the parse trees, otherwise the actions to perform revisions are determined using the model.

Reimplemented in Parser::ApParser, Parser::MeParser, and Parser::MlParser.

Definition at line 111 of file Parser.h.

void Parser::Parser::showEval ( int  tokenCount,
int  las,
int  uas,
int  sentCount 
) [virtual]

Print accuracy estimates.

Definition at line 237 of file Parser.cpp.

void Parser::Parser::writeHeader ( std::ostream &  os  ) 

Write model header to stream.

Parameters:
os 

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


Member Data Documentation

conf< int > Parser::Parser::featureCutoff [static]

Drop features which occur less than this number of times.

Definition at line 140 of file Parser.h.

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


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.