Last active
January 10, 2018 23:08
-
-
Save luizfonseca/249c88870c6a9f2f1f32a3d212654a9a to your computer and use it in GitHub Desktop.
Extremelly simple louchebem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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