Skip to content

Instantly share code, notes, and snippets.

@CyrusOfEden
Created June 14, 2014 20:58
Show Gist options
  • Save CyrusOfEden/cf55f1e9dbcad50b5ddf to your computer and use it in GitHub Desktop.
Save CyrusOfEden/cf55f1e9dbcad50b5ddf to your computer and use it in GitHub Desktop.
VOWELS = %w[a e i o u y]
def translate(words)
words.split(/\W/).map do |word|
until VOWELS.include?(word[0])
word += word[0,2] == "qu" ? word.slice!(0, 2) : word.slice!(0)
end
word + "ay"
end.join(" ")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment