|
import phonemizer
|
|
import subprocess
|
|
from ipa_uk import ipa
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
|
|
|
|
text = " Швеція. Червень. Церква. Духмяна м'ята. Вітаю, як ваші справи? У вас все гаразд? Я знаю про вас все, що ви тут робите. Але я розповім вам казку про сірого вовка який живе у лісі "
|
|
|
|
|
|
phonemes1 = phonemizer.phonemize(text, language="uk", preserve_punctuation=True)
|
|
phonemes2 = ipa(check_accent=0, text=text)
|
|
|
|
|
|
|
|
|
|
print("Input text: ",text)
|
|
print("Output phonmizer: ",phonemes1)
|
|
print("Output ipa_uk : ",phonemes2)
|
|
|
|
|
|
|
|
file_path = "output2.txt"
|
|
|
|
|
|
with open(file_path, 'w', encoding='utf-8') as file:
|
|
file.write(phonemes1)
|
|
file.write(phonemes2)
|
|
|