The derived class numbers_default implements a default number recognizer (only numbers in digits are recognized). More...
#include <numbers_modules.h>
Public Member Functions | |
numbers_default (const std::string &, const std::string &) | |
Constructor. | |
Private Member Functions | |
int | ComputeToken (int, sentence::iterator &, sentence &) |
Compute the right token code for word j from given state. | |
void | ResetActions () |
Reset acumulators used by state actions: bilion, milion, units. | |
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 current nummerical value. | |
void | SetMultiwordAnalysis (sentence::iterator, int) |
Set the appropriate lemma and parole for the new multiword. |
The derived class numbers_default implements a default number recognizer (only numbers in digits are recognized).
numbers_default::numbers_default | ( | const std::string & | dec, | |
const std::string & | thou | |||
) |
Constructor.
Create a default numbers recognizer.
References A, COD, automat::Final, automat::initialState, MAX_STATES, MAX_TOKENS, NUM, STOP, automat::stopState, TK_code, TK_num, TRACE, and automat::trans.
int numbers_default::ComputeToken | ( | int | state, | |
sentence::iterator & | j, | |||
sentence & | se | |||
) | [private, virtual] |
Compute the right token code for word j from given state.
Implements automat.
References numbers_module::RE_code, numbers_module::RE_number, TK_code, TK_num, TK_other, and TRACE.
void numbers_default::ResetActions | ( | ) | [private, virtual] |
Reset acumulators used by state actions: bilion, milion, units.
Implements automat.
References numbers_module::bilion, numbers_module::iscode, numbers_module::milion, and numbers_module::units.
void numbers_default::SetMultiwordAnalysis | ( | sentence::iterator | i, | |
int | fstate | |||
) | [private, virtual] |
Set the appropriate lemma and parole for the new multiword.
Implements automat.
References CODE, numbers_module::iscode, TRACE, and numbers_module::units.
void numbers_default::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 current nummerical value.
Implements automat.
References COD, CODE, numbers_module::iscode, numbers_module::MACO_Decimal, numbers_module::MACO_Thousand, NUM, TK_num, TRACE, and numbers_module::units.