def romanize(word: str) -> str:
if not isinstance(word, str) or not word:
return ""
word2 = _replace_vowels(_normalize(word))
res = _RE_CONSONANT.findall(word2)
After Change
def romanize(text: str) -> str:
words = word_tokenize(text)
romanized_words = [_romanize(word) for word in words]
return "".join(romanized_words)