Skip to content

Commit 2e6d4e8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3b350a1 commit 2e6d4e8

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

nemo_text_processing/text_normalization/hi/taggers/measure.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,27 @@ def __init__(self, cardinal: GraphFst, decimal: GraphFst):
6262
)
6363

6464
# Define the quarterly measurements
65-
quarter = pynini.string_map([(".५", "साढ़े"), ("१.५", "डेढ़"), ("२.५", "ढाई"),])
65+
quarter = pynini.string_map(
66+
[
67+
(".५", "साढ़े"),
68+
("१.५", "डेढ़"),
69+
("२.५", "ढाई"),
70+
]
71+
)
6672
quarter_graph = pynutil.insert("integer_part: \"") + quarter + pynutil.insert("\"")
6773

6874
# Define the unit handling
6975
unit = pynutil.insert(" units: \"") + unit_graph + pynutil.insert("\" ")
7076
units = pynutil.insert(" units: \"") + quarterly_units_graph + pynutil.insert("\" ")
7177

7278
# Handling symbols like x, X, *
73-
symbol_graph = pynini.string_map([("x", "बाई"), ("X", "बाई"), ("*", "बाई"),])
79+
symbol_graph = pynini.string_map(
80+
[
81+
("x", "बाई"),
82+
("X", "बाई"),
83+
("*", "बाई"),
84+
]
85+
)
7486

7587
graph_decimal = (
7688
pynutil.insert("decimal { ")

nemo_text_processing/text_normalization/hi/taggers/tokenize_and_classify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def __init__(
6868
os.makedirs(cache_dir, exist_ok=True)
6969
whitelist_file = os.path.basename(whitelist) if whitelist else ""
7070
far_file = os.path.join(
71-
cache_dir, f"hi_tn_{deterministic}_deterministic_{input_case}_{whitelist_file}_tokenize.far",
71+
cache_dir,
72+
f"hi_tn_{deterministic}_deterministic_{input_case}_{whitelist_file}_tokenize.far",
7273
)
7374
if not overwrite_cache and far_file and os.path.exists(far_file):
7475
self.fst = pynini.Far(far_file, mode="r")["tokenize_and_classify"]

0 commit comments

Comments
 (0)