Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0f1be7e
Polish audio text normalisation
jimregan Aug 7, 2026
4114f96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2026
fadb93d
make measure suitable for audio TN, needs more work
jimregan Aug 8, 2026
75572f2
decimals
jimregan Aug 8, 2026
7412020
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 8, 2026
26eec32
convert more names
jimregan Aug 8, 2026
e915ac5
convert more names
jimregan Aug 8, 2026
838a960
convert more names
jimregan Aug 8, 2026
f5b7c87
św.
jimregan Aug 8, 2026
99776b5
Merge branch 'polish-tn' of github.com:jimregan/NeMo-text-processing …
jimregan Aug 8, 2026
cda0665
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 8, 2026
8787290
extended time tests
jimregan Aug 8, 2026
9b8dec5
time
jimregan Aug 8, 2026
c53f241
rework
jimregan Aug 8, 2026
a1badb6
Merge branch 'polish-tn' of github.com:jimregan/NeMo-text-processing …
jimregan Aug 8, 2026
c539566
Move ordinal equivalences to data
jimregan Aug 8, 2026
1dd0e73
number nouns (2-ka -> dwójka)
jimregan Aug 9, 2026
6ac4a59
Add Polish standalone decimal normalization
jimregan Aug 9, 2026
1966f0f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 9, 2026
cd40129
Add Polish fraction normalization
jimregan Aug 9, 2026
1bf592a
Reuse decimal and fraction graphs in Polish measures
jimregan Aug 11, 2026
21dfb8f
Merge branch 'polish-tn' of github.com:jimregan/NeMo-text-processing …
jimregan Aug 15, 2026
b6b6f3f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2026
76b25dc
Add new denominators for large numbers in Polish
jimregan Aug 15, 2026
4fc7af9
Extend decimals to the same order as cardinals
jimregan Sep 1, 2026
5f22618
make tests less confusing
jimregan Sep 15, 2026
fec3532
push preferred form to top of test (this was already generated, just …
jimregan Sep 15, 2026
7326516
remove, overly specific
jimregan Sep 15, 2026
daeccab
replace
jimregan Sep 15, 2026
b6d3b3b
read small decimals as fractions
jimregan Sep 16, 2026
bb4674c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2026
890c476
more decimal
jimregan Sep 17, 2026
4b14f4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2026
f3e0235
first attempt at currency
jimregan Sep 17, 2026
c2b16da
other dollars
jimregan Sep 17, 2026
8189456
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2026
9736433
default to północ for 00:00(:00) *but* default to hours/minutes/secon…
jimregan Sep 17, 2026
08abf8c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2026
f8161ac
forgot to add in last commit
jimregan Sep 17, 2026
4e3592a
Merge branch 'polish-tn' of github.com:jimregan/NeMo-text-processing …
jimregan Sep 17, 2026
e258b46
tweak time a little more
jimregan Sep 17, 2026
9eed700
basic timezone
jimregan Sep 17, 2026
c01c3d5
inflectable abbreviations with complex parts
jimregan Sep 17, 2026
5b177f5
fix and actually test the general inflection
jimregan Sep 17, 2026
c7c1324
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nemo_text_processing/text_normalization/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def __init__(
elif lang == 'hu':
from nemo_text_processing.text_normalization.hu.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.hu.verbalizers.verbalize_final import VerbalizeFinalFst
elif lang == 'pl':
from nemo_text_processing.text_normalization.pl.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.pl.verbalizers.verbalize_final import VerbalizeFinalFst
elif lang == 'zh':
from nemo_text_processing.text_normalization.zh.taggers.tokenize_and_classify import ClassifyFst
from nemo_text_processing.text_normalization.zh.verbalizers.verbalize_final import VerbalizeFinalFst
Expand Down
13 changes: 13 additions & 0 deletions nemo_text_processing/text_normalization/pl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
13 changes: 13 additions & 0 deletions nemo_text_processing/text_normalization/pl/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s-ka spółka noun_f_ka.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tzw. tak zwany
ur. urodzony
ang. angielski
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dz. u. dziennik ustaw mi i noun_mi_k.tsv
DZ. U. dziennik ustaw mi i noun_mi_k.tsv
dz. urz. dziennik urzędowy mi adj noun_mi_k.tsv
DZ. URZ. dziennik urzędowy mi adj noun_mi_k.tsv
▲ wypełniony trójkąt skierowany w górę adj mi adj i i noun_mi_t.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
r. rok noun_mi_rok.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ dolar ma noun_ma_r.tsv cent ma noun_ma_t.tsv
USD dolar amerykański ma noun_ma_r.tsv cent ma noun_ma_t.tsv
CAD dolar kanadyjski ma noun_ma_r.tsv cent ma noun_ma_t.tsv
AUD dolar australijski ma noun_ma_r.tsv cent ma noun_ma_t.tsv
NZD dolar nowozelandzki ma noun_ma_r.tsv cent ma noun_ma_t.tsv
£ funt ma noun_ma_t.tsv pens ma noun_ma_s.tsv
GBP funt brytyjski ma noun_ma_t.tsv pens ma noun_ma_s.tsv
zł złoty ma noun_ma_y.tsv grosz mi noun_mi_sz.tsv
zl złoty ma noun_ma_y.tsv grosz mi noun_mi_sz.tsv
PLN złoty ma noun_ma_y.tsv grosz mi noun_mi_sz.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tys tysiąc
tys. tysiąc
mln milion
mln. milion
mld miliard
mld. miliard
bln bilion
bln. bilion
bld biliard
bld. biliard
trl trylion
trl. trylion
trld tryliard
trld. tryliard
13 changes: 13 additions & 0 deletions nemo_text_processing/text_normalization/pl/data/dates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sty stycznia
lut lutego
mar marca
kwi kwietnia
maj maja
cze czerwca
lip lipca
sie sierpnia
wrz września
paź października
lis listopada
gru grudnia
12 changes: 12 additions & 0 deletions nemo_text_processing/text_normalization/pl/data/dates/months.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1 stycznia
2 lutego
3 marca
4 kwietnia
5 maja
6 czerwca
7 lipca
8 sierpnia
9 września
10 października
11 listopada
12 grudnia
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
I stycznia
II lutego
III marca
IV kwietnia
V maja
VI czerwca
VII lipca
VIII sierpnia
IX września
X października
XI listopada
XII grudnia
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@toleniecki toleniecki Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the title says "denominators", but then list all the words suggesting that they are male. we typically refer to fractions as females, so "0,1" reads "zero i jedna dziesiąta" (zero and one tenth, where "thenth" is female, thus "-a", not "-y").
i am not sure what the purpose of this file is, but if its to produce TTS of "0,001" and so one, that should all end with -a instead of -y

but then it becomes plural if its anything other than "1", so e.g. "0,2" is "0 i 2 dziesiętne", "0,3" is "0 i 3 dziesiętne" etc. + above 5 it becomes "0 i 5 dziesiętnych".

note that i am not bothering you here with how to read and write numbers on purpose, because that thing alone is a huge decision tree.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjectives are relatively regular in terms of inflection, this is reusing the same mechanism that's used for ordinals.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1 dziesiąty

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"dziesiętny", if it is about denominators.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the file is poorly named, but it's decimal denominators purely, so for decimal I,D if len(D) == 1, the denominator is "tenth", len(D) == 2, "hundredth", etc.

2 setny
3 tysięczny
4 dziesięciotysięczny
5 stutysięczny
6 milionowy
7 dziesięciomilionowy
8 stumilionowy
9 miliardowy
10 dziesięciomiliardowy
11 stumiliardowy
12 bilionowy
13 dziesięciobilionowy
14 stubilionowy
15 biliardowy
16 dziesięciobiliardowy
17 stubiliardowy
18 trylionowy
19 dziesięciotrylionowy
20 stutrylionowy
21 tryliardowy
22 dziesięciotryliardowy
23 stutryliardowy
24 kwadrylionowy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
5 pół
25 ćwierć
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
named i
digits przecinek
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom a
sg_gen y
sg_dat zie
sg_acc ę
sg_ins ą
sg_loc zie
sg_voc o
pl_nom y
pl_gen <eps>
pl_dat om
pl_acc y
pl_ins ami
pl_loc ach
pl_voc y
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom ga
sg_gen gi
sg_dat dze
sg_acc gę
sg_ins gą
sg_loc dze
sg_voc go
pl_nom gi
pl_gen g
pl_dat gom
pl_acc gi
pl_ins gami
pl_loc gach
pl_voc gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom ia
sg_gen ii
sg_dat ii
sg_acc ię
sg_ins ią
sg_loc ii
sg_voc io
pl_nom ie
pl_gen ii
pl_dat iom
pl_acc ie
pl_ins iami
pl_loc iach
pl_voc ie
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom ka
sg_gen ki
sg_dat ce
sg_acc kę
sg_ins ką
sg_loc ce
sg_voc ko
pl_nom ki
pl_gen ek
pl_dat kom
pl_acc ki
pl_ins kami
pl_loc kach
pl_voc ki
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom la
sg_gen li
sg_dat li
sg_acc lę
sg_ins lą
sg_loc li
sg_voc lo
pl_nom le
pl_gen l
pl_dat lom
pl_acc li

@toleniecki toleniecki Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that does not generalize by ending, i think there is some other word feature other than ending and genus in play. e.g.
sg_nom "fala" (wave) pl_acc is "fale", not "fali" as this file suggests.

but it works for names:
sg_nom "Ala" produces pl_acc "Ali".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used with names at the moment (specifically, names of queens or saints to disambiguate a trailing roman numeral or a leading 'św.' respectively)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've stopped in the middle of "grammar" directory -- should i assume that those are all used for names? i am sorry if i am pointing out the animate vs inanimate thing over and over again, but i was told its for polish in general, but now i learn that its for some subset only, is that right?

pl_ins lami
pl_loc lach
pl_voc le
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom na
sg_gen ny
sg_dat nie
sg_acc nę
sg_ins ną
sg_loc nie
sg_voc no
pl_nom ny
pl_gen n
pl_dat nom
pl_acc ny
pl_ins nami
pl_loc nach
pl_voc ny

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is something about new line different that in other files, i am not sure if that is important.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's likely just an artifact of his editor. Not a problem for the parser.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom ta
sg_gen ty
sg_dat cie
sg_acc tę
sg_ins tą
sg_loc cie
sg_voc to
pl_nom ty
pl_gen t
pl_dat tom
pl_acc ty
pl_ins tami
pl_loc tach
pl_voc ty
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom <eps>
sg_gen a
sg_dat owi
sg_acc a
sg_ins em
sg_loc u
sg_voc ze
pl_nom y
pl_gen ów
pl_dat om
pl_acc y
pl_ins ami
pl_loc ach
pl_voc y
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom <eps>
sg_gen a
sg_dat owi
sg_acc a
sg_ins em
sg_loc ie
sg_voc ie
pl_nom y
pl_gen ów
pl_dat om
pl_acc y
pl_ins ami
pl_loc ach
pl_voc y
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom t
sg_gen ta
sg_dat towi
sg_acc ta
sg_ins tem
sg_loc cie
sg_voc cie
pl_nom ty
pl_gen tów
pl_dat tom
pl_acc ty
pl_ins tami
pl_loc tach
pl_voc ty
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom y
sg_gen ego
sg_dat emu
sg_acc ego
sg_ins ym
sg_loc ym
sg_voc y
pl_nom e
pl_gen ych
pl_dat ym
pl_acc e
pl_ins ymi
pl_loc ych
pl_voc e
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom <eps>
sg_gen a
sg_dat owi
sg_acc <eps>

@toleniecki toleniecki Sep 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here again the rule is more complex than ending alone, but this time i happen to know it has something to do with the object being inanimate vs animate (person, animal, plant). e.g.:
"kolec" (spike) sg_acc is "kolec", while animate thing like "golec" in sg acc becomes "golca".

if "mi" in the file name stands for "male inanimate", the it dismisses the comment, but then there is no "mp_c" file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended for [^e]c, I would have had noun_mi_ec.tsv for the case you're describing, and sg_nom would be 'ec' because the e is deleted. Same with -iec, same with -zec for marzec.

It would probably be easier to follow if I were to name everything in terms of a specific noun but I don't honestly imagine that anybody else will be working on this.

sg_ins em
sg_loc u
sg_voc u
pl_nom e
pl_gen ów
pl_dat om
pl_acc e
pl_ins ami
pl_loc ach
pl_voc e
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sg_nom <eps>
sg_gen a
sg_dat owi
sg_acc <eps>
sg_ins iem
sg_loc u
sg_voc u
pl_nom i
pl_gen ów
pl_dat om
pl_acc i
pl_ins ami
pl_loc ach
pl_voc i
Loading