Skip to content

Instantly share code, notes, and snippets.

@zloyrusskiy
Last active August 29, 2015 14:25
Show Gist options
  • Save zloyrusskiy/26a1a9915183aad30c21 to your computer and use it in GitHub Desktop.
Save zloyrusskiy/26a1a9915183aad30c21 to your computer and use it in GitHub Desktop.
Denu detect words
def detect_language words
if Array(words).any? { |w| w =~ /\p{Cyrillic}/ }
364
elsif Array(words).any? { |w| w =~ /\p{Hangul}/ }
0 # тут корейский код, неебу какой
else
124
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment