The derived class numbers_en implements an English number recognizer. More...
#include <numbers_modules.h>
Public Member Functions | |
numbers_en (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_en implements an English number recognizer.
numbers_en::numbers_en | ( | const std::string & | dec, | |
const std::string & | thou | |||
) |
Constructor.
Create a numbers recognizer for English.
References B1, B2, B3, B4, B5, B6, B7, B8, COD, automat::Final, automat::initialState, M1, M2, M3, M4, M5, M6, M7, M8, MAX_STATES, MAX_TOKENS, numbers_module::power, S1, S2, S3, S4, S5, S6, S7, S8, STOP, automat::stopState, TK_a, TK_and, TK_bill, TK_code, TK_hundr, TK_mill, TK_num, TK_ord, TK_thous, TK_u, numbers_module::tok, TRACE, automat::trans, and numbers_module::value.
int numbers_en::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_ord, TK_other, numbers_module::tok, and TRACE.
void numbers_en::ResetActions | ( | ) | [private, virtual] |
Reset acumulators used by state actions: bilion, milion, units.
Implements automat.
References numbers_module::bilion, numbers_module::block, numbers_module::iscode, numbers_module::milion, and numbers_module::units.
void numbers_en::SetMultiwordAnalysis | ( | sentence::iterator | i, | |
int | fstate | |||
) | [private, virtual] |
Set the appropriate lemma and parole for the new multiword.
Implements automat.
References numbers_module::bilion, CODE, numbers_module::iscode, numbers_module::milion, ORD, TRACE, and numbers_module::units.
void numbers_en::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 B2, B3, B4, B5, B6, B7, B8, numbers_module::bilion, COD, CODE, numbers_module::iscode, M1, M2, M3, M4, M5, M6, M7, M8, numbers_module::MACO_Decimal, numbers_module::MACO_Thousand, numbers_module::milion, ORD, numbers_module::power, S1, S2, S3, S4, S5, S6, S7, S8, TK_and, TK_code, TK_num, TK_ord, TRACE, numbers_module::units, and numbers_module::value.