Skip to content

Instantly share code, notes, and snippets.

@luizfonseca
Last active January 10, 2018 23:08
Show Gist options
  • Save luizfonseca/249c88870c6a9f2f1f32a3d212654a9a to your computer and use it in GitHub Desktop.
Save luizfonseca/249c88870c6a9f2f1f32a3d212654a9a to your computer and use it in GitHub Desktop.
Extremelly simple louchebem
def louchebemize_word(word)
return word if word.size <= 1
vowels = %w[a e i o u]
suffix = %w[em é ji oc ic uche ès].sample
index = word.chars.find_index { |v| vowels.include?(v) }
"l#{word[index..-1]}#{word[0...index]}#{suffix}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment