transliteration 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/transliteration.rb +26 -0
- data/transliteration.gemspec +16 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4211ee9f9d546861e1f36981c11dc24b4ab2defe
|
4
|
+
data.tar.gz: fa5471dccee0ec2e9ac3954fd6284050f473be21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cea00abc17a1a0124f04e7e3816ba02097a54e124e86daaf8d629d93c833f6c0b25b3d0e3e444ee6beadeeb18c9795ba69c091dc46fb582cde44312bbef5a67a
|
7
|
+
data.tar.gz: 2b824c08cdded87049745147ef7f3c0b374493333e1a16e8da3744e4fbd034aabbfdf880dad697d2fddf73e3667f1f6be62e2eb2ef063dd1f62291757d6de1c2
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Simpl gem for transliteration RU symbols to EN symbols.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#module Testgem
|
2
|
+
class Translit
|
3
|
+
def initialize
|
4
|
+
@hash = {'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E',
|
5
|
+
'Ж' => 'Zh', 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L', 'М' => 'M',
|
6
|
+
'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U',
|
7
|
+
'Ф' => 'F', 'Х' => 'H', 'Ц' => 'Ts', 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Shch', 'Ъ' => '',
|
8
|
+
'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu', 'Я' => 'Ya',
|
9
|
+
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'e',
|
10
|
+
'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'i', 'к' => 'k', 'л' => 'l', 'м' => 'm',
|
11
|
+
'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u',
|
12
|
+
'ф' => 'f', 'х' => 'h', 'ц' => 'ts', 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'shch', 'ъ' => '',
|
13
|
+
'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
|
14
|
+
' ' => ' ', ',' => ',', '.' => '.', '!' => '!', '?' => '?', ':' => ':'}
|
15
|
+
end
|
16
|
+
|
17
|
+
def translit(str)
|
18
|
+
str = str.split(//)
|
19
|
+
translit_str = []
|
20
|
+
str.each {|symb| translit_str << @hash[symb]}
|
21
|
+
out_str = ''
|
22
|
+
translit_str.each {|symb| out_str += symb}
|
23
|
+
out_str
|
24
|
+
end
|
25
|
+
end
|
26
|
+
#end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.authors = ["Pavel"]
|
3
|
+
gem.email = ["solonovich.pavel@gmail.com"]
|
4
|
+
gem.summary = "Simple gem for transliteration RU symbols to EN."
|
5
|
+
gem.description = "Simple gem for transliteration RU symbols to EN."
|
6
|
+
gem.homepage = ""
|
7
|
+
gem.license = "MIT"
|
8
|
+
gem.name = "transliteration"
|
9
|
+
gem.require_paths = ["lib"]
|
10
|
+
gem.version = "1.0.2"
|
11
|
+
gem.files = [
|
12
|
+
'README.md',
|
13
|
+
'transliteration.gemspec',
|
14
|
+
'lib/transliteration.rb'
|
15
|
+
]
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transliteration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel
|
@@ -16,10 +16,13 @@ email:
|
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
|
-
files:
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- lib/transliteration.rb
|
22
|
+
- transliteration.gemspec
|
20
23
|
homepage: ''
|
21
24
|
licenses:
|
22
|
-
-
|
25
|
+
- MIT
|
23
26
|
metadata: {}
|
24
27
|
post_install_message:
|
25
28
|
rdoc_options: []
|