Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pipeline {
HE_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/09-24-25-0'
HY_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/03-12-24-0'
MR_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/03-12-24-1'
HI_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/09-21-26-0'
JA_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/07-17-26-0'
KO_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/09-15-26-0'
HI_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/09-15-26-0'
DEFAULT_TN_CACHE='/home/jenkins/TestData/text_norm/ci/grammars/06-08-23-0'
}
stages {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Users यूज़र्स
User यूज़र
Desktop डेस्कटॉप
Downloads डाउनलोड्स
Documents डॉक्युमेंट्स
Music म्यूज़िक
Pictures पिक्चर्स
Videos वीडियोज़
Audio ऑडियो
file फ़ाइल
files फाइल्स
chapter चैप्टर
python पाइथन
work वर्क
about अबाउट
index इंडेक्स
tags टैग्स
app ऐप
wiki विकी
docs डॉक्स
master मास्टर
config कॉन्फ़िग
email ई मेल
apache अपाची
kernel कर्नल
bin बिन
var वार
home होम
backups बैकअप्स
temp टेम्प
data डेटा
survey सर्वे
ward वार्ड
templates टेम्पलेट्स
impress इंप्रेस
office ऑफिस
libreoffice लिब्रे ऑफिस
and एंड
LICENSE लाइसेंस
venv वेन्व
blog ब्लॉग
blogs ब्लॉग्स
login लॉगिन
register रजिस्टर
search सर्च
category केटेगरी
categories केटेगरीज़
post पोस्ट
posts पोस्ट्स
faq एफ ए क्यू
terms टर्म्स
privacy प्राइवेसी
main मेन
explore एक्सप्लोर
photos फ़ोटोज़
images इमेजेज़
web वेब
online ऑनलाइन
courses कोर्सेज़
learn लर्न
learning लर्निंग
university यूनिवर्सिटी
academy अकेडमी
domain डोमेन
domains डोमेन्स
analysis अनैलिसिस
maps मैप्स
services सर्विसेज़
sites साइट्स
activate एक्टिवेट
available अवेलेबल
enabled इनेबल्ड
secure सेक्योर
school स्कूल
homepage होमपेज
content कंटेन्ट
default डिफ़ॉल्ट
list लिस्ट
tag टैग
laptop लैपटॉप
phone फोन
play प्ले
world वर्ल्ड
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
com कॉम
org ऑर्ग
net नेट
edu ई डी यू
gov जी ओ वी
biz बिज़
info इन्फो
in इन
io आई ओ
ai ए आई
uk यू के
us यू एस
ac ए सी
res आर ई एस
nic एन आई सी
ernet ई आर नेट
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
a ए
b बी
c सी
d डी
e ई
f एफ
f एफ़
g जी
h एच
i आई
i आइ
j जे
k के
l एल
m एम
n एन
o ओ
p पी
q क्यू
r आर
s एस
t टी
u यू
v वी
w डब्ल्यू
x एक्स
y वाई
z ज़ेड
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
gmail जीमेल
yahoo याहू
hotmail हॉटमेल
outlook आउटलुक
google गूगल
blogger ब्लॉगर
live लाइव
microsoft माइक्रोसॉफ्ट
facebook फ़ेसबुक
twitter ट्विटर
instagram इंस्टाग्राम
linkedin लिंक्डइन
youtube यूट्यूब
amazon अमेज़ोन
wikipedia विकिपीडिया
github गिटहब
reddit रेडिट
netflix नेटफ्लिक्स
spotify स्पॉटिफाई
apple एप्पल
samsung सैमसंग
nvidia एनविडिया
intel इंटेल
adobe अडोब
wordpress वर्डप्रेस
mozilla मॉज़िला
ebay ई बे
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
backslash बैकवर्ड स्लैश \\
forwardslash फॉरवर्ड स्लैश /
dot डॉट .
dot DOT .
point प्वाइंट .
hyphen हाइफ़न -
hyphen हाइफन -
underscore अंडर स्कोर _
at एट
x एक्स x
space स्पेस <space>
openbracket ओपन ब्रेकेट (
closebracket क्लोज़ ब्रेकेट )
dollar डॉलर $
and एंड and
www डब्ल्यू डब्ल्यू डब्ल्यू www
v वी v
tilde टिल्ड
tilde ~
hashtag हैशटैग #
colon कोलन :
https एच टी टी पी एस कोलन फॉरवर्ड स्लैश फॉरवर्ड स्लैश https://
http एच टी टी पी कोलन फॉरवर्ड स्लैश फॉरवर्ड स्लैश http://
litslash / /
lithyphen - -
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
इज़ इक्वल टू =
बराबर होता है =
इक्वल टू =
बराबर है =
इक्वल्स =
बराबर =
इक्वल =
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
प्लस +
जमा +
जोड़ +
माइनस -
घटा -
डिवाइडेड /
भाग /
मल्टीप्लाइड ×
गुणा ×
गुना ×
इनटू ×
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2026, NVIDIA CORPORATION. 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,4 @@
अध्याय
खंड
खण्ड
कक्षा
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
IV 4
IX 9
XL 40
XC 90
CD 400
CM 900
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
टु द पावर ^
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
स्क्वेर्ड ^2
क्यूब ^3
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
एक्सटेंशन ext.
एक्स्टेंशन ext.
एक्सटेंशन नंबर ext.
एक्स्टेंशन नंबर ext.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
IST आई एस टी
IST भारतीय मानक समय
IST भारतीय समयानुसार
GMT जी एम टी
UTC यू टी सी
PST पी एस टी
EST ई एस टी
43 changes: 43 additions & 0 deletions nemo_text_processing/inverse_text_normalization/hi/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@
NEMO_HI_DIGIT = pynini.union("०", "१", "२", "३", "४", "५", "६", "७", "८", "९").optimize()
DEVANAGARI_DIGIT = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"]

DIGIT_GLYPH_TO_ASCII = pynini.union(
*[pynini.cross(glyph, str(value)) for value, glyph in enumerate(DEVANAGARI_DIGIT)]
).optimize()
DIGIT_WORD_TO_DEVANAGARI = (
pynini.string_file(get_abs_path("data/numbers/digit.tsv")).invert()
| pynini.string_file(get_abs_path("data/numbers/zero.tsv")).invert()
).optimize()

# Devanagari characters (consonants, vowels, matras, signs) excluding the digits
# (0x0966-0x096F). Shared so classes like serial and electronic can reuse it.
DEVANAGARI_LETTER = pynini.union(
*[chr(c) for c in range(0x0900, 0x0966)],
*[chr(c) for c in range(0x0970, 0x0980)],
).optimize()

NEMO_HEX = pynini.union(*string.hexdigits).optimize()
NEMO_NON_BREAKING_SPACE = u"\u00a0"
NEMO_ZWNJ = u"\u200c"
Expand Down Expand Up @@ -83,6 +98,34 @@ def generator_main(file_name: str, graphs: Dict[str, 'pynini.FstLike']):
logging.info(f'Created {file_name}')


def load_symbols(path):
"""
Builds a dict mapping a symbol name to an FST that deletes a spoken Hindi
phrase and inserts its written form. TSV columns: name, spoken phrase, output
(optional). Rows sharing a name are unioned; "<space>" in the output inserts a
space.
"""
table = {}
with open(path, encoding="utf-8") as f:
for line in f:
line = line.rstrip("\r\n")
if not line or line.startswith("#"):
continue
cols = line.split("\t")
name = cols[0]
words = cols[1].split(" ")
out = cols[2] if len(cols) > 2 else ""
if out == "<space>":
out = " "
fst = pynutil.delete(words[0])
for word in words[1:]:
fst += delete_space + pynutil.delete(word)
if out:
fst += pynutil.insert(out)
table[name] = (table[name] | fst) if name in table else fst
return table


def convert_space(fst) -> 'pynini.FstLike':
"""
Converts space to nonbreaking space.
Expand Down
Loading
Loading