en_us_normalization.production.verbalize.CardinalFst
- class en_us_normalization.production.verbalize.CardinalFst[source]
Finite state transducer for verbalizing cardinal number. A pretrained FAR is used to avoid writing down all the rules for number expansion. Check verbalizer specification for list of possible fields.
Apart from cardinal expansion, grammar also provides some fsts to be reused in other semiotic classes:
expand number digit by digit
expand number grouping digits in to pairs
Examples of input/output strings:
cardinal|negative:1|count:23| -> minus twenty three
cardinal|prefix:number|count:21| -> number twenty one
- get_cardinal_expanding_fst()[source]
helper function that provides and fst to expand cardinals. can be reused by other semiotic classes. simply attach to your own FST or cross with permissive FST to limit number of digits for expansion.