Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

automat Class Reference

Abstract class to implement a Finite-State Automaton which is used by modules recognizing multiwords (dates, numbers, quantities, . More...

#include <automat.h>

Inheritance diagram for automat:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 automat ()
 Constructor.
virtual ~automat ()
 Destructor.
void annotate (sentence &)
 Detect patterns in sentence using default options.

Protected Attributes

int initialState
 state code of initial state
int stopState
 state code for stop State
int trans [MAX_STATES][MAX_TOKENS]
 Transition tables.
set< int > Final
 set of final states

Private Member Functions

virtual int ComputeToken (int, sentence::const_iterator, const sentence &)=0
 pure virtual function to be provided by the child class.
virtual void ResetActions ()=0
 pure virtual function to be provided by the child class .
virtual void StateActions (int, int, int, sentence::const_iterator)=0
 pure virtual function to be provided by the child class.
virtual void SetMultiwordAnalysis (sentence::iterator) const =0
 pure virtual function to be provided by the child class.
virtual bool ValidMultiWord (const word &) const
 virtual function (true by default).
sentence::iterator BuildMultiword (sentence &, sentence::iterator, sentence::iterator) const
 Private function to re-arrange sentence when match found.

Detailed Description

Abstract class to implement a Finite-State Automaton which is used by modules recognizing multiwords (dates, numbers, quantities, .

..).

Details:

Child classes must provide a constructor that:

Child classes must provide the virtual functions:

Child classes must declare and manage any private attribute or function they may need to perform the expected computations


Constructor & Destructor Documentation

automat::automat  ) 
 

Constructor.

Since automat is an abstract class, this is called always from child constructors.

virtual automat::~automat  )  [inline, virtual]
 

Destructor.


Member Function Documentation

void automat::annotate sentence se  ) 
 

Detect patterns in sentence using default options.

Recognize the longest pattern starting at first possible start found. Repeat the process starting from first word after recognized pattern, until sentence ends.

sentence::iterator automat::BuildMultiword sentence ,
sentence::iterator  ,
sentence::iterator 
const [private]
 

Private function to re-arrange sentence when match found.

virtual int automat::ComputeToken int  ,
sentence::const_iterator  ,
const sentence
[private, pure virtual]
 

pure virtual function to be provided by the child class.

Computes token code for current word in current state.

Implemented in dates_default, dates_es, dates_ca, locutions, np, numbers_default, numbers_es, numbers_ca, numbers_gl, numbers_en, quantities_default, and quantities_es.

virtual void automat::ResetActions  )  [private, pure virtual]
 

pure virtual function to be provided by the child class .

Resets automaton internal variables when a new search is started.

Implemented in dates_default, dates_es, dates_ca, locutions, np, numbers_default, numbers_es, numbers_ca, numbers_gl, numbers_en, quantities_default, and quantities_es.

virtual void automat::SetMultiwordAnalysis sentence::iterator   )  const [private, pure virtual]
 

pure virtual function to be provided by the child class.

Sets analysis for pattern identified as a multiword.

Implemented in dates_default, dates_es, dates_ca, locutions, np, numbers_default, numbers_es, numbers_ca, numbers_gl, numbers_en, quantities_default, and quantities_es.

virtual void automat::StateActions int  ,
int  ,
int  ,
sentence::const_iterator 
[private, pure virtual]
 

pure virtual function to be provided by the child class.

Performs appropriate internal actions, given origin and destinanation states, token code and word.

Implemented in dates_default, dates_es, dates_ca, locutions, np, numbers_default, numbers_es, numbers_ca, numbers_gl, numbers_en, quantities_default, and quantities_es.

bool automat::ValidMultiWord const word  )  const [private, virtual]
 

virtual function (true by default).

Allows the child class to perform a last-minute check before effectively building the multiword.

Reimplemented in np.


Member Data Documentation

set<int> automat::Final [protected]
 

set of final states

int automat::initialState [protected]
 

state code of initial state

int automat::stopState [protected]
 

state code for stop State

int automat::trans[MAX_STATES][MAX_TOKENS] [protected]
 

Transition tables.


The documentation for this class was generated from the following files:
Generated on Wed Apr 26 12:57:33 2006 for FreeLing by  doxygen 1.4.4