Repository: allo-media/text2num

Issue:
Issue when there is 'zéro' before other letters
Ex OK:
```
data_zero = 'zéro'
print(alpha2digit(data_zero, 'fr'))
0
```
Ex: NOK:
```
data1 = 'a a un trois sept trois trois sept cinq quatre zéro c c'
data2 = 'b b un trois sept trois trois sept cinq quatre zéro d d'
print(alpha2digit(data1, 'fr'))
print(alpha2digit(data2, 'fr'))
a a 1 3 7 3 3 7 5 4 zéro c c 
b b 1 3 7 3 3 7 5 4 zéro d d
```

We can see `zéro` is not transform to digit 0.

thanks in advance for your help
have a good day

Comments:

Patch:
diff --git a/text_to_num/lang/base.py b/text_to_num/lang/base.py
index b2a8cc9..e349c1c 100644
--- a/text_to_num/lang/base.py
+++ b/text_to_num/lang/base.py
@@ -70,7 +70,7 @@ class Language:
         return NotImplemented
 
     def not_numeric_word(self, word: Optional[str]) -> bool:
-        return word is None or word != self.DECIMAL_SEP and word not in self.NUMBERS
+        return word is None or word != self.DECIMAL_SEP and word not in self.NUMBERS and word not in self.ZERO
 
     def split_number_word(self, word: str) -> str:  # maybe use: List[str]
         """In some languages numbers are written as one word, e.g. German
diff --git a/text_to_num/lang/english.py b/text_to_num/lang/english.py
index e155a2e..4286476 100644
--- a/text_to_num/lang/english.py
+++ b/text_to_num/lang/english.py
@@ -117,7 +117,7 @@ class English(Language):
 
     AND_NUMS: Set[str] = set()
     AND = "and"
-    NEVER_IF_ALONE = {"one"}
+    NEVER_IF_ALONE = {"one", "o"}
 
     # Relaxed composed numbers (two-words only)
     # start => (next, target)
diff --git a/text_to_num/parsers.py b/text_to_num/parsers.py
index d66d9ed..72c3add 100644
--- a/text_to_num/parsers.py
+++ b/text_to_num/parsers.py
@@ -655,21 +655,21 @@ class WordToDigitParser:
         elif (
             word in self.lang.ZERO
             and self.at_start_of_seq()
-            and (
-                look_ahead is None
-                or look_ahead in self.lang.NUMBERS
-                or look_ahead in self.lang.ZERO
-                or look_ahead in self.lang.DECIMAL_SEP
-            )
+            and look_ahead is not None
+            and look_ahead in self.lang.DECIMAL_SEP
         ):
-            self._value.append("0")
+            pass
         elif (
             word in self.lang.ZERO
             and self.at_start_of_seq()
-            and look_ahead is not None
-            and look_ahead in self.lang.DECIMAL_SEP
+            # and (
+            #     look_ahead is None
+            #     or look_ahead in self.lang.NUMBERS
+            #     or look_ahead in self.lang.ZERO
+            #     or look_ahead in self.lang.DECIMAL_SEP
+            # )
         ):
-            pass
+            self._value.append("0")
         elif self._push(self.lang.ord2card(word) or "", look_ahead):
             self._value.append(
                 self.lang.num_ord(


Test patch:
diff --git a/tests/test_text_to_num_en.py b/tests/test_text_to_num_en.py
index b6a71ad..d12341b 100644
--- a/tests/test_text_to_num_en.py
+++ b/tests/test_text_to_num_en.py
@@ -126,6 +126,7 @@ class TestTextToNumEN(TestCase):
         self.assertEqual(alpha2digit(source, "en"), expected)
 
         self.assertEqual(alpha2digit("zero", "en"), "0")
+        self.assertEqual(alpha2digit("zero love", "en"), "0 love")
 
     def test_alpha2digit_ordinals(self):
         source = (
diff --git a/tests/test_text_to_num_fr.py b/tests/test_text_to_num_fr.py
index accd0ef..c9ba038 100644
--- a/tests/test_text_to_num_fr.py
+++ b/tests/test_text_to_num_fr.py
@@ -143,6 +143,8 @@ class TestTextToNumFR(TestCase):
         # self.assertEqual(alpha2digit(source, "fr"), source)
 
         self.assertEqual(alpha2digit("zéro", "fr"), "0")
+        self.assertEqual(alpha2digit("a a un trois sept trois trois sept cinq quatre zéro c c", "fr"), "a a 1 3 7 3 3 7 5 4 0 c c")
+        self.assertEqual(alpha2digit("sept un zéro", "fr"), "7 1 0")
 
     def test_alpha2digit_ordinals(self):
         source = (