Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 031e90a24c59f9ab5d04956a67c605618d2ae65a @AVVS committed Feb 12, 2013
Showing with 32 additions and 0 deletions.
  1. +5 −0 README.md
  2. +9 −0 index.js
  3. +18 −0 package.json
5 README.md
@@ -0,0 +1,5 @@
+# Transliterate module - changes cyrillic symbols into latin ones
+
+Usage example:
+
+### result = transliterate(word)
9 index.js
@@ -0,0 +1,9 @@
+a = {"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"","б":"b","ю":"yu"}
+
+transliterate = function(word){
+ return word.split('').map(function(char){
+ return if typeof a[char] isnt 'undefined' then a[char] else char
+ }).join("");
+}
+
+module.exports = transliterate
18 package.json
@@ -0,0 +1,18 @@
+{
+ "name": "transliterate",
+ "description": "Transliterates cyrillic symbols into latin ones",
+ "keywords": [
+ "util",
+ "functional",
+ ],
+ "author": {
+ "name": "Vitaly Aminev",
+ "email": "v@avvs.co"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/AVVS/node-transliteration.git"
+ },
+ "version": "0.0.1",
+ "readmeFilename": "README.md"
+}

0 comments on commit 031e90a

Please sign in to comment.