Python program to translate sentences

Given a sentencen in ‘bird language’, where there are two rules:

  1. After each consonant there is a random vowel added, for example if the consonant is “l” it willm end as “la” or “le”…
  2. After each vowel there are two extra vowels which are the same as the first, for example if there is an “u” it will end as “uuu”

    • Vowels are “aeiou”

Examples:

  • hieeelalaooo -> hello
  • hoooowe yyyooouuu
  • duoooiiine -> how you doin
  • aaa bo cy da eee fe -> a b c d e f
  • sooooso aaaaaaaaa -> sos aaa

The code

def translate(phrase):  result = "" num_of_letters_to_ignore = 0  for i, letter in enumerate(phrase):     if num_of_letters_to_ignore > 0:         num_of_letters_to_ignore -= 1         continue      if letter in VOWELS:         num_of_letters_to_ignore += 2     elif letter.isalpha():         num_of_letters_to_ignore += 1     result += letter  return result 

How can it be improved?