Created
May 18, 2019 17:32
-
-
Save Cool-Programmer/32590a52006a6b1b1ddb75f34d6bd370 to your computer and use it in GitHub Desktop.
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
const alphabet = { | |
"ա":"a", "բ":"b", "գ":"g", "դ":"d", "ե":"e", "զ":"z", | |
"է":"e", "ը":"y", "թ":"t", "ժ":"zh", "ի":"i", "լ":"l", | |
"խ":"kh", "ծ":"ts", "կ":"k", "հ":"h", "ձ":"dz", "ղ":"gh", | |
"ճ":"ch", "մ":"m", "յ":"y", "ն":"n", "շ":"sh", "ո":"v", | |
"չ":"ch", "պ":"p", "ջ":"j", "ռ":"r", "ս":"s", "վ":"v", | |
"տ":"t", "ր":"r", "ց":"c", "ու":"u", "փ":"p", "ք":"q", | |
"և":"ev", "օ":"o", "ֆ":"f", "եւ":"ev", | |
"Ա":"a", "Բ":"b", "Գ":"g", "Դ":"d", "Ե":"e", "Զ":"z", | |
"Է":"e", "Ը":"y", "Թ":"t", "Ժ":"zh", "Ի":"i", "Լ":"l", | |
"Խ":"kh", "Ծ":"ts", "Կ":"k", "Հ":"h", "Ձ":"dz", "Ղ":"gh", | |
"Ճ":"ch", "Մ":"m", "Յ":"y", "Ն":"n", "Շ":"sh", "Ո":"v", | |
"Չ":"ch", "Պ":"p", "Ջ":"j", "Ռ":"r", "Ս":"s", "Վ":"v", | |
"Տ":"t", "Ր":"r", "Ց":"c", "Ու":"u", "Փ":"p", "Ք":"q", | |
"Օ":"o", "Ֆ":"f", "Եւ":"ev" | |
}; | |
function transliterate(word){ | |
return word.split('').map(function (char) { | |
return alphabet[char] || char; | |
}).join(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment