Created
August 10, 2012 14:39
-
-
Save xfenix/3314707 to your computer and use it in GitHub Desktop.
EnglishToRussian conversion table
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
table = function(code) { | |
var s = 'фисвуапршолдьтщзйкыегмцчня', | |
b = 'ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ', | |
c = s.length, | |
A = [], | |
A2 = [], | |
A3 = {91: 'х', 93: 'ъ', 59: 'ж', 39: 'э', 44: 'б', 46: 'ю', 123: 'Х', 125: 'Ъ', 58: 'Ж', 34: 'Э', 60: 'Б', 62: 'Ю'}, | |
T = [], | |
sk = 96, | |
bk = 64; | |
for(i = 0; i < c; ++i) A[++sk] = s[i]; | |
for(i = 0; i < c; ++i) A2[++bk] = b[i]; | |
T = code > 96 && code < 123 ? A : (code > 64 && code < 91 ? A2 : A3); | |
return T[code] != undefined ? T[code] : ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
фисвуапршолдьтщзйкыегмцчня