ukrainian-tts / stress_with_model.py
Yurii Paniv
Apply black formatter
12ee3cc
raw history blame
No virus
1.27 kB
import ukrainian_accentor as accentor
# run
def stress_with_model(text: str):
text = text.lower()
result = accentor.process(text, mode="plus")
return result
if __name__ == "__main__":
sentence = "Кам'янець-Подільський - місто в Хмельницькій області України, центр Кам'янець-Подільської міської об'єднаної територіальної громади і Кам'янець-Подільського району."
print(stress_with_model(sentence))
sentence = "Привіт, як тебе звати?"
print(stress_with_model(sentence))
sentence = "АННА - український панк-рок гурт"
print(stress_with_model(sentence))
sentence = "Не тільки в Україні таке може бути."
print(stress_with_model(sentence))
sentence = "Не тільки в +Укра+їні т+аке може бути."
print(stress_with_model(sentence))
sentence = "два + два"
print(stress_with_model(sentence))
sentence = "Н тльк в крн тк мж бт."
print(stress_with_model(sentence))
sentence = "Н тльк в крн тк мж бт."
print(stress_with_model(sentence))