Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lang tet coverage ony, fix line 157 and 175 #27

Merged
merged 2 commits into from
Jun 1, 2024
Merged
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
25 changes: 3 additions & 22 deletions num2words/lang_TET.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

from __future__ import division, unicode_literals

import re

from num2words.currency import parse_currency_parts, prefix_currency
from num2words.currency import parse_currency_parts

from .lang_EU import Num2Word_EU

Expand Down Expand Up @@ -142,23 +141,8 @@ def remove_ho(self, result, value):
def to_cardinal(self, value):
result = super().to_cardinal(value)

# Transforms "mil e cento e catorze" into "mil cento e catorze"
# Transforms "cem milhões e duzentos mil e duzentos e dez" em "cem
# milhões duzentos mil duzentos e dez" but "cem milhões e duzentos
# mil e duzentos" in "cem milhões duzentos mil e duzentos" and not in
# "cem milhões duzentos mil duzentos"
for ext in (
'rihun', 'miliaun', 'miliaun rihun',
'biliaun', 'biliaun rihun'):
if re.match(
'.*{} resin \\w*entus? (?=.*resin)'.format(ext),
result
):
result = result.replace(
f'{ext} resin', f'{ext}'
)
result = self.remove_ho(result, value)
return result
results = self.remove_ho(result, value)
return results

def to_ordinal(self, value):
self.verify_ordinal(value)
Expand All @@ -172,9 +156,6 @@ def to_ordinal(self, value):
value = abs(value)
out = "%s " % self.negword.strip()

if value >= self.MAXVAL:
raise OverflowError(self.errmsg_toobig % (value, self.MAXVAL))

val = self.splitnum(value)
outs = val
while len(val) != 1:
Expand Down