From d3aca75280ee8978791ca76c47f883272139d404 Mon Sep 17 00:00:00 2001 From: Bryan Anderson Date: Mon, 16 Dec 2024 16:34:28 -0800 Subject: [PATCH] Add support for Hindi language Copied from stale PR here: https://github.com/savoirfairelinux/num2words/pull/442 --- README.rst | 3 +- num2words/__init__.py | 12 +- num2words/lang_HI.py | 199 ++++++++++++++++++++++++++++ tests/test_hi.py | 301 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 509 insertions(+), 6 deletions(-) create mode 100644 num2words/lang_HI.py create mode 100644 tests/test_hi.py diff --git a/README.rst b/README.rst index 7e0bc1f2..29f8d064 100644 --- a/README.rst +++ b/README.rst @@ -103,6 +103,7 @@ Besides the numerical argument, there are two main optional arguments, ``to:`` a * ``fr_CH`` (French - Switzerland) * ``fr_DZ`` (French - Algeria) * ``he`` (Hebrew) +* ``hi`` (Hindi) * ``hu`` (Hungarian) * ``id`` (Indonesian) * ``is`` (Icelandic) @@ -163,4 +164,4 @@ added Lithuanian support, but didn't take over maintenance of the project. I am thus basing myself on Marius Grigaitis' improvements and re-publishing ``pynum2word`` as ``num2words``. -Virgil Dupras, Savoir-faire Linux \ No newline at end of file +Virgil Dupras, Savoir-faire Linux diff --git a/num2words/__init__.py b/num2words/__init__.py index 882aa229..9e5d44bd 100644 --- a/num2words/__init__.py +++ b/num2words/__init__.py @@ -21,11 +21,12 @@ lang_CS, lang_CY, lang_DA, lang_DE, lang_EN, lang_EN_IN, lang_EN_NG, lang_EO, lang_ES, lang_ES_CO, lang_ES_CR, lang_ES_GT, lang_ES_NI, lang_ES_VE, lang_FA, lang_FI, lang_FR, - lang_FR_BE, lang_FR_CH, lang_FR_DZ, lang_HE, lang_HU, lang_ID, - lang_IS, lang_IT, lang_JA, lang_KN, lang_KO, lang_KZ, lang_LT, - lang_LV, lang_NL, lang_NO, lang_PL, lang_PT, lang_PT_BR, - lang_RO, lang_RU, lang_SK, lang_SL, lang_SR, lang_SV, lang_TE, - lang_TET, lang_TG, lang_TH, lang_TR, lang_UK, lang_VI) + lang_FR_BE, lang_FR_CH, lang_FR_DZ, lang_HE, lang_HI, lang_HU, + lang_ID, lang_IS, lang_IT, lang_JA, lang_KN, lang_KO, lang_KZ, + lang_LT, lang_LV, lang_NL, lang_NO, lang_PL, lang_PT, + lang_PT_BR, lang_RO, lang_RU, lang_SK, lang_SL, lang_SR, + lang_SV, lang_TE, lang_TET, lang_TG, lang_TH, lang_TR, lang_UK, + lang_VI) CONVERTER_CLASSES = { 'am': lang_AM.Num2Word_AM(), @@ -84,6 +85,7 @@ 'tet': lang_TET.Num2Word_TET(), 'hu': lang_HU.Num2Word_HU(), 'is': lang_IS.Num2Word_IS(), + 'hi': lang_HI.Num2Word_HI(), } CONVERTES_TYPES = ['cardinal', 'ordinal', 'ordinal_num', 'year', 'currency'] diff --git a/num2words/lang_HI.py b/num2words/lang_HI.py new file mode 100644 index 00000000..b397f3c4 --- /dev/null +++ b/num2words/lang_HI.py @@ -0,0 +1,199 @@ +# -*- encoding: utf-8 -*- +# Copyright (c) 2003, Taro Ogawa. All Rights Reserved. +# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA + +from __future__ import unicode_literals + +import string + +from num2words.base import Num2Word_Base + + +class Num2Word_HI(Num2Word_Base): + """ + Hindi (HI) Num2Word class + """ + + _irregular_ordinals = { + 0: "शून्य", + 1: "पहला", + 2: "दूसरा", + 3: "तीसरा", + 4: "चौथा", + 6: "छठा", + } + _irregular_ordinals_nums = { + 0: "०", + 1: "१ला", + 2: "२रा", + 3: "३रा", + 4: "४था", + 6: "६ठा", + } + _hindi_digits = "०१२३४५६७८९" # 0-9 + _digits_to_hindi_digits = dict(zip(string.digits, _hindi_digits)) + _regular_ordinal_suffix = "वाँ" + + def setup(self): + # Note: alternative forms are informal + self.low_numwords = [ + "निन्यानवे", + "अट्ठानवे", + "सत्तानवे", # alternative "सतानवे" + "छियानवे", + "पचानवे", + "चौरानवे", + "तिरानवे", + "बानवे", + "इक्यानवे", + "नब्बे", + "नवासी", + "अट्ठासी", + "सतासी", + "छियासी", + "पचासी", + "चौरासी", + "तिरासी", + "बयासी", + "इक्यासी", + "अस्सी", + "उनासी", # alternative "उन्नासी" + "अठहत्तर", # alternative "अठहतर" + "सतहत्तर", # alternative "सतहतर" + "छिहत्तर", # alternative "छिहतर" + "पचहत्तर", # alternative "पचहतर" + "चौहत्तर", # alternative "चौहतर" + "तिहत्तर", # alternative "तिहतर" + "बहत्तर", # alternative "बहतर" + "इकहत्तर", # alternative "इकहतर" + "सत्तर", + "उनहत्तर", # alternative "उनहतर" + "अड़सठ", # alternative "अड़सठ" + "सड़सठ", # alternative "सड़सठ" + "छियासठ", + "पैंसठ", + "चौंसठ", + "तिरसठ", + "बासठ", + "इकसठ", + "साठ", + "उनसठ", + "अट्ठावन", # alternative "अठावन" + "सत्तावन", # alternative "सतावन" + "छप्पन", + "पचपन", + "चौवन", + "तिरेपन", # alternative "तिरपन" + "बावन", + "इक्यावन", + "पचास", + "उनचास", + "अड़तालीस", # alternative "अड़तालीस" + "सैंतालीस", + "छियालीस", # alternative "छयालिस" + "पैंतालीस", + "चौवालीस", # alternative "चवालीस" + "तैंतालीस", # alternative "तैतालीस" + "बयालीस", + "इकतालीस", + "चालीस", + "उनतालीस", + "अड़तीस", # alternative "अड़तीस" + "सैंतीस", + "छत्तीस", # alternative "छतीस" + "पैंतीस", + "चौंतीस", + "तैंतीस", + "बत्तीस", # alternative "बतीस" + "इकत्तीस", # alternative "इकतीस" + "तीस", + "उनतीस", + "अट्ठाईस", # alternative "अट्ठाइस" + "सत्ताईस", # alternative "सताइस" + "छब्बीस", + "पच्चीस", + "चौबीस", + "तेईस", # alternative "तेइस" + "बाईस", + "इक्कीस", # alternative "इकीस" + "बीस", + "उन्नीस", + "अट्ठारह", # alternative "अठारह" + "सत्रह", + "सोलह", + "पंद्रह", + "चौदह", + "तेरह", + "बारह", + "ग्यारह", + "दस", + "नौ", + "आठ", + "सात", + "छः", # alternative "छह" + "पाँच", # alternative "पांच" + "चार", + "तीन", + "दो", + "एक", + "शून्य", + ] + + self.mid_numwords = [(100, "सौ")] + self.high_numwords = [ + (11, "ख़रब"), + (9, "अरब"), + (7, "करोड़"), # alternative "करोड़" + (5, "लाख"), + (3, "हज़ार"), # alternative "हज़ार" + ] + self.pointword = "दशमलव" + self.negword = "माइनस " + + def set_high_numwords(self, high): + for n, word in self.high_numwords: + self.cards[10**n] = word + + def merge(self, lpair, rpair): + ltext, lnum = lpair + rtext, rnum = rpair + if lnum == 1 and rnum < 100: + return rtext, rnum + elif lnum >= 100 > rnum: + return "%s %s" % (ltext, rtext), lnum + rnum + elif rnum > lnum: + return "%s %s" % (ltext, rtext), lnum * rnum + return "%s %s" % (ltext, rtext), lnum + rnum + + def to_ordinal(self, value): + if value in self._irregular_ordinals: + return self._irregular_ordinals[value] + + # regular Hindi ordinals are derived from cardinals + # by modifying the last member of the expression. + cardinal = self.to_cardinal(value) + return cardinal + self._regular_ordinal_suffix + + def _convert_to_hindi_numerals(self, value): + return "".join(map(self._digits_to_hindi_digits.__getitem__, + str(value))) + + def to_ordinal_num(self, value): + if value in self._irregular_ordinals_nums: + return self._irregular_ordinals_nums[value] + + return self._convert_to_hindi_numerals(value) \ + + self._regular_ordinal_suffix diff --git a/tests/test_hi.py b/tests/test_hi.py new file mode 100644 index 00000000..9a23e586 --- /dev/null +++ b/tests/test_hi.py @@ -0,0 +1,301 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2003, Taro Ogawa. All Rights Reserved. +# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved. + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA + +from unittest import TestCase + +from num2words import num2words + +# number, hindi number, pronounced form +TEST_CASES_CARDINAL = ( + (0, u"०", u"शून्य"), + (1, u"१", u"एक"), + (2, u"२", u"दो"), + (3, u"३", u"तीन"), + (4, u"४", u"चार"), + (5, u"५", u"पाँच"), + (6, u"६", u"छः"), + (7, u"७", u"सात"), + (8, u"८", u"आठ"), + (9, u"९", u"नौ"), + (10, u"१०", u"दस"), + (11, u"११", u"ग्यारह"), + (12, u"१२", u"बारह"), + (13, u"१३", u"तेरह"), + (14, u"१४", u"चौदह"), + (15, u"१५", u"पंद्रह"), + (16, u"१६", u"सोलह"), + (17, u"१७", u"सत्रह"), + (18, u"१८", u"अट्ठारह"), + (19, u"१९", u"उन्नीस"), + (20, u"२०", u"बीस"), + (21, u"२१", u"इक्कीस"), + (22, u"२२", u"बाईस"), + (23, u"२३", u"तेईस"), + (24, u"२४", u"चौबीस"), + (25, u"२५", u"पच्चीस"), + (26, u"२६", u"छब्बीस"), + (27, u"२७", u"सत्ताईस"), + (28, u"२८", u"अट्ठाईस"), + (29, u"२९", u"उनतीस"), + (30, u"३०", u"तीस"), + (31, u"३१", u"इकत्तीस"), + (32, u"३२", u"बत्तीस"), + (33, u"३३", u"तैंतीस"), + (34, u"३४", u"चौंतीस"), + (35, u"३५", u"पैंतीस"), + (36, u"३६", u"छत्तीस"), + (37, u"३७", u"सैंतीस"), + (38, u"३८", u"अड़तीस"), + (39, u"३९", u"उनतालीस"), + (40, u"४०", u"चालीस"), + (41, u"४१", u"इकतालीस"), + (42, u"४२", u"बयालीस"), + (43, u"४३", u"तैंतालीस"), + (44, u"४४", u"चौवालीस"), + (45, u"४५", u"पैंतालीस"), + (46, u"४६", u"छियालीस"), + (47, u"४७", u"सैंतालीस"), + (48, u"४८", u"अड़तालीस"), + (49, u"४९", u"उनचास"), + (50, u"५०", u"पचास"), + (51, u"५१", u"इक्यावन"), + (52, u"५२", u"बावन"), + (53, u"५३", u"तिरेपन"), + (54, u"५४", u"चौवन"), + (55, u"५५", u"पचपन"), + (56, u"५६", u"छप्पन"), + (57, u"५७", u"सत्तावन"), + (58, u"५८", u"अट्ठावन"), + (59, u"५९", u"उनसठ"), + (60, u"६०", u"साठ"), + (61, u"६१", u"इकसठ"), + (62, u"६२", u"बासठ"), + (63, u"६३", u"तिरसठ"), + (64, u"६४", u"चौंसठ"), + (65, u"६५", u"पैंसठ"), + (66, u"६६", u"छियासठ"), + (67, u"६७", u"सड़सठ"), + (68, u"६८", u"अड़सठ"), + (69, u"६९", u"उनहत्तर"), + (70, u"७०", u"सत्तर"), + (71, u"७१", u"इकहत्तर"), + (72, u"७२", u"बहत्तर"), + (73, u"७३", u"तिहत्तर"), + (74, u"७४", u"चौहत्तर"), + (75, u"७५", u"पचहत्तर"), + (76, u"७६", u"छिहत्तर"), + (77, u"७७", u"सतहत्तर"), + (78, u"७८", u"अठहत्तर"), + (79, u"७९", u"उनासी"), + (80, u"८०", u"अस्सी"), + (81, u"८१", u"इक्यासी"), + (82, u"८२", u"बयासी"), + (83, u"८३", u"तिरासी"), + (84, u"८४", u"चौरासी"), + (85, u"८५", u"पचासी"), + (86, u"८६", u"छियासी"), + (87, u"८७", u"सतासी"), + (88, u"८८", u"अट्ठासी"), + (89, u"८९", u"नवासी"), + (90, u"९०", u"नब्बे"), + (91, u"९१", u"इक्यानवे"), + (92, u"९२", u"बानवे"), + (93, u"९३", u"तिरानवे"), + (94, u"९४", u"चौरानवे"), + (95, u"९५", u"पचानवे"), + (96, u"९६", u"छियानवे"), + (97, u"९७", u"सत्तानवे"), + (98, u"९८", u"अट्ठानवे"), + (99, u"९९", u"निन्यानवे"), + (100, u"१००", u"एक सौ"), + (1000, u"१०००", u"एक हज़ार"), + (10000, u"१००००", u"दस हज़ार"), + (100000, u"१०००००", u"एक लाख"), + (1000000, u"१००००००", u"दस लाख"), + (10000000, u"१०००००००", u"एक करोड़"), + (100000000, u"१००००००००", u"दस करोड़"), + (1000000000, u"१०००००००००", u"एक अरब"), + (10000000000, u"१००००००००००", u"दस अरब"), + (100000000000, u"१०००००००००००", u"एक ख़रब"), + (1000000000000, u"१००००००००००००", u"दस ख़रब"), + (1234, u"१२३४", u"एक हज़ार दो सौ चौंतीस"), + (8901234, u"८९०१२३४", u"नवासी लाख एक हज़ार दो सौ चौंतीस"), + (567890123, u"५६७८९०१२३", + u"छप्पन करोड़ अठहत्तर लाख नब्बे हज़ार एक सौ तेईस"), + (113345, u"११३३४५", u"एक लाख तेरह हज़ार तीन सौ पैंतालीस"), +) + +# number, hindi numeric notation, pronounced form +TEST_CASES_ORDINAL = ( + (0, u"०", u"शून्य"), # zero is used in cardinal form + (1, u"१ला", u"पहला"), + (2, u"२रा", u"दूसरा"), + (3, u"३रा", u"तीसरा"), + (4, u"४था", u"चौथा"), + (5, u"५वाँ", u"पाँचवाँ"), + (6, u"६ठा", u"छठा"), + (7, u"७वाँ", u"सातवाँ"), + (8, u"८वाँ", u"आठवाँ"), + (9, u"९वाँ", u"नौवाँ"), + (10, u"१०वाँ", u"दसवाँ"), + (11, u"११वाँ", u"ग्यारहवाँ"), + (12, u"१२वाँ", u"बारहवाँ"), + (13, u"१३वाँ", u"तेरहवाँ"), + (14, u"१४वाँ", u"चौदहवाँ"), + (15, u"१५वाँ", u"पंद्रहवाँ"), + (16, u"१६वाँ", u"सोलहवाँ"), + (17, u"१७वाँ", u"सत्रहवाँ"), + (18, u"१८वाँ", u"अट्ठारहवाँ"), + (19, u"१९वाँ", u"उन्नीसवाँ"), + (20, u"२०वाँ", u"बीसवाँ"), + (21, u"२१वाँ", u"इक्कीसवाँ"), + (22, u"२२वाँ", u"बाईसवाँ"), + (23, u"२३वाँ", u"तेईसवाँ"), + (24, u"२४वाँ", u"चौबीसवाँ"), + (25, u"२५वाँ", u"पच्चीसवाँ"), + (26, u"२६वाँ", u"छब्बीसवाँ"), + (27, u"२७वाँ", u"सत्ताईसवाँ"), + (28, u"२८वाँ", u"अट्ठाईसवाँ"), + (29, u"२९वाँ", u"उनतीसवाँ"), + (30, u"३०वाँ", u"तीसवाँ"), + (31, u"३१वाँ", u"इकत्तीसवाँ"), + (32, u"३२वाँ", u"बत्तीसवाँ"), + (33, u"३३वाँ", u"तैंतीसवाँ"), + (34, u"३४वाँ", u"चौंतीसवाँ"), + (35, u"३५वाँ", u"पैंतीसवाँ"), + (36, u"३६वाँ", u"छत्तीसवाँ"), + (37, u"३७वाँ", u"सैंतीसवाँ"), + (38, u"३८वाँ", u"अड़तीसवाँ"), + (39, u"३९वाँ", u"उनतालीसवाँ"), + (40, u"४०वाँ", u"चालीसवाँ"), + (41, u"४१वाँ", u"इकतालीसवाँ"), + (42, u"४२वाँ", u"बयालीसवाँ"), + (43, u"४३वाँ", u"तैंतालीसवाँ"), + (44, u"४४वाँ", u"चौवालीसवाँ"), + (45, u"४५वाँ", u"पैंतालीसवाँ"), + (46, u"४६वाँ", u"छियालीसवाँ"), + (47, u"४७वाँ", u"सैंतालीसवाँ"), + (48, u"४८वाँ", u"अड़तालीसवाँ"), + (49, u"४९वाँ", u"उनचासवाँ"), + (50, u"५०वाँ", u"पचासवाँ"), + (51, u"५१वाँ", u"इक्यावनवाँ"), + (52, u"५२वाँ", u"बावनवाँ"), + (53, u"५३वाँ", u"तिरेपनवाँ"), + (54, u"५४वाँ", u"चौवनवाँ"), + (55, u"५५वाँ", u"पचपनवाँ"), + (56, u"५६वाँ", u"छप्पनवाँ"), + (57, u"५७वाँ", u"सत्तावनवाँ"), + (58, u"५८वाँ", u"अट्ठावनवाँ"), + (59, u"५९वाँ", u"उनसठवाँ"), + (60, u"६०वाँ", u"साठवाँ"), + (61, u"६१वाँ", u"इकसठवाँ"), + (62, u"६२वाँ", u"बासठवाँ"), + (63, u"६३वाँ", u"तिरसठवाँ"), + (64, u"६४वाँ", u"चौंसठवाँ"), + (65, u"६५वाँ", u"पैंसठवाँ"), + (66, u"६६वाँ", u"छियासठवाँ"), + (67, u"६७वाँ", u"सड़सठवाँ"), + (68, u"६८वाँ", u"अड़सठवाँ"), + (69, u"६९वाँ", u"उनहत्तरवाँ"), + (70, u"७०वाँ", u"सत्तरवाँ"), + (71, u"७१वाँ", u"इकहत्तरवाँ"), + (72, u"७२वाँ", u"बहत्तरवाँ"), + (73, u"७३वाँ", u"तिहत्तरवाँ"), + (74, u"७४वाँ", u"चौहत्तरवाँ"), + (75, u"७५वाँ", u"पचहत्तरवाँ"), + (76, u"७६वाँ", u"छिहत्तरवाँ"), + (77, u"७७वाँ", u"सतहत्तरवाँ"), + (78, u"७८वाँ", u"अठहत्तरवाँ"), + (79, u"७९वाँ", u"उनासीवाँ"), + (80, u"८०वाँ", u"अस्सीवाँ"), + (81, u"८१वाँ", u"इक्यासीवाँ"), + (82, u"८२वाँ", u"बयासीवाँ"), + (83, u"८३वाँ", u"तिरासीवाँ"), + (84, u"८४वाँ", u"चौरासीवाँ"), + (85, u"८५वाँ", u"पचासीवाँ"), + (86, u"८६वाँ", u"छियासीवाँ"), + (87, u"८७वाँ", u"सतासीवाँ"), + (88, u"८८वाँ", u"अट्ठासीवाँ"), + (89, u"८९वाँ", u"नवासीवाँ"), + (90, u"९०वाँ", u"नब्बेवाँ"), + (91, u"९१वाँ", u"इक्यानवेवाँ"), + (92, u"९२वाँ", u"बानवेवाँ"), + (93, u"९३वाँ", u"तिरानवेवाँ"), + (94, u"९४वाँ", u"चौरानवेवाँ"), + (95, u"९५वाँ", u"पचानवेवाँ"), + (96, u"९६वाँ", u"छियानवेवाँ"), + (97, u"९७वाँ", u"सत्तानवेवाँ"), + (98, u"९८वाँ", u"अट्ठानवेवाँ"), + (99, u"९९वाँ", u"निन्यानवेवाँ"), + (100, u"१००वाँ", u"एक सौवाँ"), + (1000, u"१०००वाँ", u"एक हज़ारवाँ"), + (100000, u"१०००००वाँ", u"एक लाखवाँ"), + (1000000, u"१००००००वाँ", u"दस लाखवाँ"), + (10000000, u"१०००००००वाँ", u"एक करोड़वाँ"), + (100000000, u"१००००००००वाँ", u"दस करोड़वाँ"), + (1000000000, u"१०००००००००वाँ", u"एक अरबवाँ"), + (10000000000, u"१००००००००००वाँ", u"दस अरबवाँ"), + (100000000000, u"१०००००००००००वाँ", u"एक ख़रबवाँ"), + (1000000000000, u"१००००००००००००वाँ", u"दस ख़रबवाँ"), +) + + +class Num2WordsHITest(TestCase): + def test_cardinal(self): + for number, _, words in TEST_CASES_CARDINAL: + self.assertEqual( + num2words(number, lang="hi"), + words, + msg="failing number %s" % number, + ) + + def test_negative_cardinal(self): + self.assertEqual(num2words(-42, lang="hi"), u"माइनस बयालीस") + + def test_float_cardinal(self): + self.assertEqual(num2words(12.5, lang="hi"), u"बारह दशमलव पाँच") + self.assertEqual(num2words(12.51, lang="hi"), u"बारह दशमलव पाँच एक") + + def test_ordinal(self): + for number, _, words in TEST_CASES_ORDINAL: + self.assertEqual( + num2words(number, lang="hi", ordinal=True), + words, + msg="failing number %s" % number, + ) + + def test_ordinal_num(self): + for number, numeric_notation, _ in TEST_CASES_ORDINAL: + self.assertEqual( + num2words(number, lang="hi", to="ordinal_num"), + numeric_notation, + msg="failing number %s" % number, + ) + + # In python3, Hindi numbers are implicitly converted into number + # as `assert int('४२') == 42`. + # Thus it's possible to pass Hindi numbers string directly + # to the num2words as `num2words('४२', lang='hi')`. + # This will work for any language, + # but is relevant to test for Hindi particularly. + def test_hindi_numeric_input(self): + for number, hindi_number, words in TEST_CASES_CARDINAL: + self.assertEqual( + num2words(hindi_number, lang="hi"), + words, + msg="failing number %s" % number, + )