en_us_normalization.production.classify.CardinalFst

class en_us_normalization.production.classify.CardinalFst[source]

Finite state transducer for classifying cardinals - numbers expressing amount. Most of the work is done in verbalization of cardinals, in classifying only few things to take into account

  • there shouldn’t be too many digits. If there are too many, pronounce them letter by letter. for now the limit is 6.

  • number can be negative, i.e. have “-” in front of it

  • amount can’t start with zero

  • cardinal numbers can be separate with commas, for ex.: 1,000,000

  • cardinal number can be pre-pended with prefix, for ex “#”

Examples of cardinals: - -23 -> cardinal { negative: “true” count: “23” } - 4,123 -> cardinal { count: “4123” } - # 21 -> cardinal { prefix: “number” count: “21” }

__init__()[source]
get_digits_fst() pynini.FstLike[source]

getter for reusable fst with cardinal digits that can be reused in other transducers