en_us_normalization.production.classify.MoneyFst

class en_us_normalization.production.classify.MoneyFst(decimal: Optional[DecimalFst] = None)[source]

Finite state transducer for classifying money, suppletive aware. Reuses decimal transducer prepending or appending currency. Currencies are listed in “currency/major.tsv” data file. Most of the work is done in verbalizer to assign major/minor currencies.

Examples of input and tagged money strings:

  • $12.05 -> money { currency: “$” decimal { integer_part: “12” fractional_part: “05” } }

  • $1 -> money { currency: “$” decimal { integer_part: “1” } }

  • 13.99£ -> money { decimal { integer_part: “13” fractional_part: “99” } currency: “£” }

__init__(decimal: Optional[DecimalFst] = None)[source]

constructor of money tagging transuducer

Parameters
decimal: DecimalFst

decimal transducer to reuse for amount. if not provided, created from scratch.