Repository: allo-media/text2num

Issue:
Spanish numbers like ciento veintitrés not correctly converted
The number "ciento veintitrés" in Spanish is converted to 100 instead of 123. It seems "veintitrés" is not recognized.

Discussion:

Patch:
diff --git a/text_to_num/lang/spanish.py b/text_to_num/lang/spanish.py
index cecbf8d..679ccde 100644
--- a/text_to_num/lang/spanish.py
+++ b/text_to_num/lang/spanish.py
@@ -61,6 +61,10 @@ STENS: Dict[str, int] = {
     )
 }
 
+STENS["veintitrés"] = 23
+STENS["veintidós"] = 22
+
+
 # Ten multiples
 # Ten multiples may be followed by a unit only;
 MTENS: Dict[str, int] = {


Test patch:
diff --git a/tests/test_text_to_num_es.py b/tests/test_text_to_num_es.py
index 7633952..e6974ae 100644
--- a/tests/test_text_to_num_es.py
+++ b/tests/test_text_to_num_es.py
@@ -38,6 +38,8 @@ class TestTextToNumES(TestCase):
         self.assertEqual(text2num("diecinueve", "es"), 19)
         self.assertEqual(text2num("veinte", "es"), 20)
         self.assertEqual(text2num("veintiuno", "es"), 21)
+        self.assertEqual(text2num("veintitres", "es"), 23)
+        self.assertEqual(text2num("veintitrés", "es"), 23)
         self.assertEqual(text2num("treinta", "es"), 30)
         self.assertEqual(text2num("treinta y uno", "es"), 31)
         self.assertEqual(text2num("treinta y dos", "es"), 32)