diff --git a/text2SAMPA.py b/text2SAMPA.py index d987b38..1a3000a 100644 --- a/text2SAMPA.py +++ b/text2SAMPA.py @@ -86,6 +86,7 @@ def create_syllables(word, vowels): def convert_to_SAMPA(word): + word = word.lower() syllables = create_syllables(word, vowels) letters_in_stressed_syllable = [False] * len(word) # print(syllables) @@ -152,6 +153,11 @@ def convert_to_SAMPA(word): word = list(''.join(word)) + test_word = ''.join(word) + test_word = test_word.replace('"', '').replace(':', '') + if len(test_word) <= 1: + return ''.join(word) + previous_letter_i = -1 letter_i = 0 next_letter_i = 1