From 41c0e23c4d21d8558c185c480b628c3b69c94143 Mon Sep 17 00:00:00 2001 From: pengzhendong <275331498@qq.com> Date: Tue, 9 Jun 2026 17:04:37 +0800 Subject: [PATCH] fix: add missing space between digit groups in comma-separated numbers (#291) Numbers like 0,013,225 were normalized to "oh zero one threetwo two five" with "three" and "two" concatenated. The comma-separated digit groups in single_digits_graph_with_commas lacked a space separator between groups. --- tn/english/rules/cardinal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tn/english/rules/cardinal.py b/tn/english/rules/cardinal.py index 77b9d97..0eade0d 100644 --- a/tn/english/rules/cardinal.py +++ b/tn/english/rules/cardinal.py @@ -72,7 +72,13 @@ def build_tagger(self): + single_digits_graph + self.INSERT_SPACE + single_digits_graph - ).plus + + (self.INSERT_SPACE + pynutil.delete(",") + + single_digits_graph + + self.INSERT_SPACE + + single_digits_graph + + self.INSERT_SPACE + + single_digits_graph).star + ) ) graph = (