mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
Update cardinal.py
it will make numbers like "three thousand and one" convert into "30001" not "3001".
This commit is contained in:
parent
3eeee44576
commit
d6e8c17ba6
@ -27,7 +27,7 @@ class CardinalFst(GraphFst):
|
||||
graph_hundreds = pynini.string_file(get_abs_path("data/numbers/hundreds.tsv"))
|
||||
graph_thousand = pynini.string_file(get_abs_path("data/numbers/thousand.tsv"))
|
||||
|
||||
graph_cents = pynini.cross("seratus", "100") | pynini.cross("ratus", "100") | pynini.union(graph_hundreds, pynutil.insert("00"))
|
||||
graph_cents = pynini.cross("seratus", "100") | pynini.cross("ratus", "100") | pynini.union(graph_hundreds, pynutil.insert("0"))
|
||||
graph_hundred = pynini.cross("ratus", "") | pynini.cross("seratus", "")
|
||||
|
||||
graph_hundred_component = pynini.union(graph_digit + delete_space + graph_hundred, pynutil.insert("00"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user