Created
November 15, 2020 15:38
-
-
Save KozhevnikovM/703f35cbeded75784d5c06e22822aed7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_dividere_lettere(string): | |
cleared_string = clear_string(string) | |
pointer = 0 | |
current_syllable = '' | |
for letter in cleared_string: | |
pointer += 1 | |
current_syllable += letter | |
stayed_string = cleared_string[pointer:] | |
if not stayed_string: | |
yield current_syllable | |
raise StopIteration | |
if is_vowel(letter) and not is_vowel(stayed_string[0]): | |
current_syllable = '' | |
yield current_syllable | |
poem_syllables = [get_dividere_lettere(line) for line in poem] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment