FreeLing  3.0
Public Member Functions | Private Member Functions | Private Attributes
locutions Class Reference

Class locutions recognizes multiwords belonging to a list obtained from a configuration file. More...

#include <locutions.h>

Inheritance diagram for locutions:
Inheritance graph
[legend]
Collaboration diagram for locutions:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 locutions (const std::wstring &)
 Constructor.
void add_locution (const std::wstring &)
 Add a locution rule to the multiword recognizer.

Private Member Functions

void check (const std::wstring, std::set< std::wstring > &, bool &, bool &)
int ComputeToken (int, sentence::iterator &, sentence &)
 Compute the right token code for word j from given state.
void ResetActions ()
 Reset current multiword acumulator.
void StateActions (int, int, int, sentence::const_iterator)
 Perform necessary actions in "state" reached from state "origin" via word j interpreted as code "token": Basically, when reaching a state, update accumulated multiword.
void SetMultiwordAnalysis (sentence::iterator, int)
 Set the appropriate lemma and tag for the new multiword.
bool ValidMultiWord (const word &)
 Perform last minute validation before effectively building multiword.

Private Attributes

std::map< std::wstring,
std::wstring > 
locut
 store multiword list
std::set< std::wstring > prefixes
 store multiword prefixes
std::set< std::wstring > acc_mw
 partially build multiword.
std::set< std::wstring > longest_mw
std::vector< wordcomponents
 store mw components in case we need to recover them
int over_longest
 count words scanned beyond last longest mw found.
std::list< analysismw_analysis
 analysis assigned to the mw by the validation step
bool mw_ambiguous
 segmentantion ambiguity status of the multiword

Detailed Description

Class locutions recognizes multiwords belonging to a list obtained from a configuration file.


Constructor & Destructor Documentation

locutions::locutions ( const std::wstring &  locFile)

Member Function Documentation

void locutions::add_locution ( const std::wstring &  line)

Add a locution rule to the multiword recognizer.

References locut, and prefixes.

Referenced by locutions().

void locutions::check ( const std::wstring  ,
std::set< std::wstring > &  ,
bool ,
bool  
) [private]

References locut, longest_mw, over_longest, prefixes, and TRACE.

Referenced by ComputeToken(), and ValidMultiWord().

int locutions::ComputeToken ( int  state,
sentence::iterator &  j,
sentence se 
) [private, virtual]

Compute the right token code for word j from given state.

Implements automat.

References acc_mw, check(), components, util::int2wstring(), over_longest, TK_mw, TK_other, TK_pref, and TRACE.

void locutions::ResetActions ( ) [private, virtual]

Reset current multiword acumulator.

Implements automat.

References acc_mw, components, longest_mw, and mw_analysis.

void locutions::SetMultiwordAnalysis ( sentence::iterator  i,
int  fstate 
) [private, virtual]

Set the appropriate lemma and tag for the new multiword.

Implements automat.

References mw_ambiguous, mw_analysis, and TRACE.

void locutions::StateActions ( int  origin,
int  state,
int  token,
sentence::const_iterator  j 
) [private, virtual]

Perform necessary actions in "state" reached from state "origin" via word j interpreted as code "token": Basically, when reaching a state, update accumulated multiword.

Implements automat.

References longest_mw, and TRACE.

bool locutions::ValidMultiWord ( const word w) [private, virtual]

Perform last minute validation before effectively building multiword.

Reimplemented from automat.

References check(), components, ERROR_CRASH, word::get_lc_form(), util::int2wstring(), locut, longest_mw, mw_ambiguous, mw_analysis, over_longest, TRACE, util::wstring2int(), and util::wstring2list().


Member Data Documentation

std::set<std::wstring> locutions::acc_mw [private]

partially build multiword.

Referenced by ComputeToken(), and ResetActions().

std::vector<word> locutions::components [private]

store mw components in case we need to recover them

Referenced by ComputeToken(), ResetActions(), and ValidMultiWord().

std::map<std::wstring,std::wstring> locutions::locut [private]

store multiword list

Referenced by add_locution(), check(), and ValidMultiWord().

std::set<std::wstring> locutions::longest_mw [private]

segmentantion ambiguity status of the multiword

Referenced by SetMultiwordAnalysis(), and ValidMultiWord().

std::list<analysis> locutions::mw_analysis [private]

analysis assigned to the mw by the validation step

Referenced by ResetActions(), SetMultiwordAnalysis(), and ValidMultiWord().

int locutions::over_longest [private]

count words scanned beyond last longest mw found.

Referenced by check(), ComputeToken(), and ValidMultiWord().

std::set<std::wstring> locutions::prefixes [private]

store multiword prefixes

Referenced by add_locution(), and check().


The documentation for this class was generated from the following files: