Spaces:
Sleeping
Sleeping
mrfakename
commited on
Commit
•
d9dff52
1
Parent(s):
c609d03
Test GRUUT phonemizer
Browse files
test.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from gruut import sentences
|
2 |
+
|
3 |
+
|
4 |
+
text = input("> ")
|
5 |
+
phonemes = ''
|
6 |
+
for sent in sentences(text, lang="en-us"):
|
7 |
+
for word in sent:
|
8 |
+
if word.phonemes:
|
9 |
+
print(word.text + ":" + ''.join(word.phonemes))
|
10 |
+
phonemes += ''.join(word.phonemes)
|
11 |
+
else:
|
12 |
+
print(word.text + ": NoPhonemes")
|
13 |
+
print("--")
|
14 |
+
print(phonemes)
|