en_us_normalization.production.verbalize.DateFst

class en_us_normalization.production.verbalize.DateFst(cardinal: Optional[CardinalFst] = None, ordinal: Optional[OrdinalFst] = None)[source]

Finite state transducer for verbalization of dates. Reuses cardinal and ordinal FSTs to expand numbers. Ordinal is needed for days (for ex. fifth of february) and cardinal is meant to expand years. Years expansion can be tricky, often year is read 2 digits at a time (2012 -> twenty twelve).

Examples of input/output strings:

  • date|month:february|day:5|year:2012| -> february fifth twenty twelve

  • date|day:5|month:february|year:2012| -> the fifth of february twenty twelve

__init__(cardinal: Optional[CardinalFst] = None, ordinal: Optional[OrdinalFst] = None)[source]