wrap inflect in try catch

This commit is contained in:
patil-suraj 2022-06-17 13:48:51 +02:00
parent d76bc43720
commit 800b27703e
1 changed files with 5 additions and 1 deletions

View File

@ -236,8 +236,12 @@ def english_cleaners(text):
text = collapse_whitespace(text)
return text
try:
_inflect = inflect.engine()
except:
print("inflect is not installed")
_inflect = None
_inflect = inflect.engine()
_comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")
_decimal_number_re = re.compile(r"([0-9]+\.[0-9]+)")
_pounds_re = re.compile(r"£([0-9\,]*[0-9]+)")