Skip to content

Instantly share code, notes, and snippets.

@KozhevnikovM
Created November 15, 2020 15:38
Show Gist options
  • Save KozhevnikovM/703f35cbeded75784d5c06e22822aed7 to your computer and use it in GitHub Desktop.
Save KozhevnikovM/703f35cbeded75784d5c06e22822aed7 to your computer and use it in GitHub Desktop.
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