Last active
August 29, 2015 14:25
-
-
Save zloyrusskiy/26a1a9915183aad30c21 to your computer and use it in GitHub Desktop.
Denu detect words
This file contains 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 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