require "debugger"

def word=(word)
  @word = word
end

def word
  @word
end

# word start

def vowels
  ['a','e','i','o','u']
end

def vowel_start?(word)
  vowels.include?(word.chars.first)
end

def two_vowel_start?(word)
  first, second = word.chars.to_a
  vowels.include?(first) && vowels.include?(second)
end

def two_consonant_start?(word)
  first, second = word.chars.to_a
  !vowels.include?(first) && !vowels.include?(second)
end

def translate(word)
    if word.match(/ /)
      word.slice!(' ')
      trans
    end
    # Vowel
    if two_vowel_start?(word)
      head, body = word[0..1], word[2..-1]
      body + head+ "ay"
    elsif vowel_start?(word)
      word +'ay' 
    elsif two_consonant_start?(word)
      head, body = word[0..1], word[2..-1]
      body + head+ "ay"
    else #single consonant start
      word[1..-1] + word[0] + "ay"
    #double constant
    end
end
