any_ascii 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/any_ascii.rb +40 -33
- data/lib/data/00c +0 -0
- data/lib/data/011 +1 -1
- data/lib/data/012 +0 -0
- data/lib/data/013 +0 -0
- data/lib/data/015 +0 -0
- data/lib/data/02d +0 -0
- data/lib/data/037 +0 -0
- data/lib/data/041 +0 -0
- data/lib/data/04d +0 -0
- data/lib/data/09f +0 -0
- data/lib/data/0ab +0 -0
- data/lib/data/0f9 +0 -0
- data/lib/data/101 +0 -0
- data/lib/data/104 +0 -0
- data/lib/data/112 +2 -2
- data/lib/data/11b +0 -0
- data/lib/data/11f +1 -1
- data/lib/data/134 +1 -2
- data/lib/data/170 +0 -0
- data/lib/data/171 +0 -0
- data/lib/data/172 +0 -0
- data/lib/data/173 +0 -0
- data/lib/data/174 +0 -0
- data/lib/data/175 +0 -0
- data/lib/data/176 +0 -0
- data/lib/data/177 +0 -0
- data/lib/data/178 +0 -0
- data/lib/data/179 +0 -0
- data/lib/data/17a +0 -0
- data/lib/data/17b +0 -0
- data/lib/data/17c +0 -0
- data/lib/data/17d +0 -0
- data/lib/data/17f +0 -0
- data/lib/data/180 +0 -0
- data/lib/data/181 +0 -0
- data/lib/data/182 +0 -0
- data/lib/data/183 +0 -0
- data/lib/data/184 +0 -0
- data/lib/data/185 +0 -0
- data/lib/data/186 +0 -0
- data/lib/data/187 +0 -0
- data/lib/data/18b +0 -0
- data/lib/data/18c +0 -0
- data/lib/data/1b0 +0 -0
- data/lib/data/1b1 +0 -0
- data/lib/data/1d2 +1 -1
- data/lib/data/1df +1 -1
- data/lib/data/1e0 +2 -1
- data/lib/data/1e4 +0 -0
- data/lib/data/1e7 +0 -0
- data/lib/data/1f6 +0 -0
- data/lib/data/1f7 +0 -0
- data/lib/data/1fa +0 -0
- data/lib/data/201 +2 -3
- data/lib/data/205 +0 -0
- data/lib/data/21d +0 -0
- data/lib/data/223 +0 -0
- data/lib/data/227 +0 -0
- data/lib/data/23b +0 -0
- data/lib/data/240 +0 -0
- data/lib/data/24c +0 -0
- data/lib/data/277 +0 -0
- data/lib/data/27c +0 -0
- data/lib/data/28e +0 -0
- data/lib/data/297 +0 -0
- data/lib/data/2a6 +1 -2
- data/lib/data/2b1 +0 -0
- data/lib/data/2b3 +0 -0
- data/lib/data/2b5 +1 -2
- data/lib/data/2b7 +0 -0
- data/lib/data/2ba +1 -1
- data/lib/data/2bb +2 -2
- data/lib/data/2c0 +0 -0
- data/lib/data/2c2 +0 -0
- data/lib/data/2c8 +0 -0
- data/lib/data/2c9 +0 -0
- data/lib/data/2cb +0 -0
- data/lib/data/2cd +2 -3
- data/lib/data/2d2 +0 -0
- data/lib/data/2d3 +0 -0
- data/lib/data/2ea +0 -0
- data/lib/data/2eb +0 -0
- data/lib/data/2f8 +0 -0
- data/lib/data/300 +0 -0
- data/lib/data/302 +2 -1
- data/lib/data/303 +2 -2
- data/lib/data/304 +0 -0
- data/lib/data/30b +0 -0
- data/lib/data/30d +0 -0
- data/lib/data/30f +2 -2
- data/lib/data/310 +0 -0
- data/lib/data/313 +2 -2
- data/lib/data/314 +0 -0
- data/lib/data/315 +0 -0
- data/lib/data/316 +0 -0
- data/lib/data/317 +0 -0
- data/lib/data/318 +0 -0
- data/lib/data/319 +0 -0
- data/lib/data/31f +0 -0
- data/lib/data/320 +0 -0
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c3183f6a96c4202783bf2839869be7121d626b5b596fa726eba4ebd649740b
|
4
|
+
data.tar.gz: 6e82a5cfce595c64944b0f01bc7342270cb8d654e662f50bfb57daa28e393cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d42506ac053db28bdd0831ba2533bb586ec857bc1edcdc02ff78b1c11ba39d0202ec6782068441536633a87e057c71e90d45ead88c47fa6617b6ceca3d088c
|
7
|
+
data.tar.gz: d22c000c97b25ee26814b257c8fdb549a557e5cc219a65e73914747ab136331e561c299cb17e14d49286eabbd39a491e0cc8b559056ddfced69722fe31da9df0
|
data/LICENSE
CHANGED
data/lib/any_ascii.rb
CHANGED
@@ -1,40 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'zlib'
|
2
4
|
|
5
|
+
# Unicode to ASCII transliteration
|
3
6
|
module AnyAscii
|
7
|
+
def self.transliterate(string)
|
8
|
+
return string if string.ascii_only?
|
9
|
+
|
10
|
+
result = String.new('')
|
11
|
+
string.each_codepoint do |cp|
|
12
|
+
if cp <= 127
|
13
|
+
result << cp
|
14
|
+
else
|
15
|
+
block_num = cp >> 8
|
16
|
+
lo = cp & 0xff
|
17
|
+
block = BLOCKS[block_num]
|
18
|
+
result << block[lo] if lo < block.length
|
19
|
+
end
|
20
|
+
end
|
21
|
+
result
|
22
|
+
end
|
23
|
+
|
24
|
+
BLOCKS = Hash.new do |blocks, block_num|
|
25
|
+
blocks[block_num] = read_block(block_num)
|
26
|
+
end
|
27
|
+
private_constant :BLOCKS
|
4
28
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
b = IO.binread(file_name)
|
9
|
-
zi = Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
10
|
-
s = zi.inflate(b)
|
11
|
-
zi.close
|
12
|
-
block = s.split("\t")
|
13
|
-
else
|
14
|
-
block = []
|
15
|
-
end
|
16
|
-
blocks[block_num] = block
|
17
|
-
end
|
29
|
+
def self.read_block(block_num)
|
30
|
+
file_name = File.join(__dir__, 'data', format('%03x', block_num))
|
31
|
+
return [] unless File.file?(file_name)
|
18
32
|
|
19
|
-
|
33
|
+
unzip(File.binread(file_name))
|
34
|
+
.force_encoding(Encoding::UTF_8)
|
35
|
+
.split("\t")
|
36
|
+
end
|
37
|
+
private_class_method :read_block
|
20
38
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
else
|
30
|
-
block_num = cp >> 8
|
31
|
-
lo = cp & 0xff
|
32
|
-
block = BLOCKS[block_num]
|
33
|
-
if block.length > lo
|
34
|
-
result << block[lo]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
return result
|
39
|
-
end
|
39
|
+
def self.unzip(string)
|
40
|
+
zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
41
|
+
buf = zstream.inflate(string)
|
42
|
+
zstream.finish
|
43
|
+
zstream.close
|
44
|
+
buf
|
45
|
+
end
|
46
|
+
private_class_method :unzip
|
40
47
|
end
|
data/lib/data/00c
CHANGED
Binary file
|
data/lib/data/011
CHANGED
@@ -1 +1 @@
|
|
1
|
-
M��n� �� ���9'����Ӥq!{vG���SY8O2�q��6������A�j�.T�ȕ��ѬxJ�|�/�.S���Zox����Ҡ�P�"\���]]������~��*>��vD����$j4Er{���ZѪ������S7jdɀí\N��6�k�Vo'��Tc�Vf坸�`$�ᆎ�hm�Tn\]6uT�f]��l`���m�A[b8�ʘ
|
1
|
+
M��n� �� ���9'����Ӥq!{vG���SY8O2�q��6������A�j�.T�ȕ��ѬxJ�|�/�.S���Zox����Ҡ�P�"\���]]������~��*>��vD����$j4Er{���ZѪ������S7jdɀí\N��6�k�Vo'��Tc�Vf坸�`$�ᆎ�hm�Tn\]6uT�f]��l`���m�A[b8�ʘ
|
data/lib/data/012
CHANGED
Binary file
|
data/lib/data/013
CHANGED
Binary file
|
data/lib/data/015
CHANGED
Binary file
|
data/lib/data/02d
CHANGED
Binary file
|
data/lib/data/037
CHANGED
Binary file
|
data/lib/data/041
CHANGED
Binary file
|
data/lib/data/04d
CHANGED
Binary file
|
data/lib/data/09f
CHANGED
Binary file
|
data/lib/data/0ab
CHANGED
Binary file
|
data/lib/data/0f9
CHANGED
Binary file
|
data/lib/data/101
CHANGED
Binary file
|
data/lib/data/104
CHANGED
Binary file
|
data/lib/data/112
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
���
|
2
|
-
�0
|
1
|
+
���
|
2
|
+
�0D��_��)�/�[q��i+��f��#f L �Y����)�b:**�.ddB��}K+��2��WM-T���̝�N� ��2y�)���g(�P�(~X`��w�x�����*�%���+�XMJz�s,Y�fÖ�'
|
data/lib/data/11b
ADDED
Binary file
|
data/lib/data/11f
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��M�@����pm�*'�(���G�E��^�v�w�������=q�(���^�E�R�)yA�zOG���̺�-[ˁ���7ˎ�����Ųac9QI#���F���Q��Z.jѡ!���4�Xx���c1�?V����t#|����
|
data/lib/data/134
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
���h����4&�W?҅nT�'�g���o�E�Ӟ�}%M���m�}X�݁�.ډ��F�?
|
1
|
+
�=�0����?o�*nM\\�aQ!8����M�s����,����N$54p��@d v�)���{2�'��9�ͣwᱝ�ġ���BE}}�B���[r1�t��AQc��e[��^�� �j�ꤍX[���
|
data/lib/data/170
CHANGED
Binary file
|
data/lib/data/171
CHANGED
Binary file
|
data/lib/data/172
CHANGED
Binary file
|
data/lib/data/173
CHANGED
Binary file
|
data/lib/data/174
CHANGED
Binary file
|
data/lib/data/175
CHANGED
Binary file
|
data/lib/data/176
CHANGED
Binary file
|
data/lib/data/177
CHANGED
Binary file
|
data/lib/data/178
CHANGED
Binary file
|
data/lib/data/179
CHANGED
Binary file
|
data/lib/data/17a
CHANGED
Binary file
|
data/lib/data/17b
CHANGED
Binary file
|
data/lib/data/17c
CHANGED
Binary file
|
data/lib/data/17d
CHANGED
Binary file
|
data/lib/data/17f
CHANGED
Binary file
|
data/lib/data/180
CHANGED
Binary file
|
data/lib/data/181
CHANGED
Binary file
|
data/lib/data/182
CHANGED
Binary file
|
data/lib/data/183
CHANGED
Binary file
|
data/lib/data/184
CHANGED
Binary file
|
data/lib/data/185
CHANGED
Binary file
|
data/lib/data/186
CHANGED
Binary file
|
data/lib/data/187
CHANGED
Binary file
|
data/lib/data/18b
CHANGED
Binary file
|
data/lib/data/18c
CHANGED
Binary file
|
data/lib/data/1b0
CHANGED
Binary file
|
data/lib/data/1b1
CHANGED
Binary file
|
data/lib/data/1d2
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Ő;BA�9R�$����Xt��ԙ�ca��L2JT��@-�q`a��Z����=\ӛ�_�<�&�<9�En*��9���Ԣ��g����������;
|
data/lib/data/1df
CHANGED
@@ -1 +1 @@
|
|
1
|
-
%�A�
|
1
|
+
%�A�0���6�F��pP_��vgڹ�{`��yQqF�����-,�;���\,8kjz���
|
data/lib/data/1e0
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
��Q!��$�k]V
|
2
|
+
�b,�,����l�� �6�&Ly ,t�N"�DV�\�R�qǩ4N��23��%%��u�z�j����-�kW��G� ��+<>SD�/����� I!G�+=
|
data/lib/data/1e4
ADDED
Binary file
|
data/lib/data/1e7
CHANGED
Binary file
|
data/lib/data/1f6
CHANGED
Binary file
|
data/lib/data/1f7
CHANGED
Binary file
|
data/lib/data/1fa
CHANGED
Binary file
|
data/lib/data/201
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
D!?� ����>[��rb����w�SựB�p���v�N��x#��zKfغ1���Ź�cױ<gu�����ށC�-���"�|���zv�f��r�}|Gi��G�S=hWH��9�{W7d3����UZi��P'w�`����Y}vd��@&��R\?�c���
|
1
|
+
mQA�� <�A��4�T�D���7h��:���߱i�jƞa�UH#f�=�1y��+��&��
|
2
|
+
����=!���
|
data/lib/data/205
CHANGED
Binary file
|
data/lib/data/21d
CHANGED
Binary file
|
data/lib/data/223
CHANGED
Binary file
|
data/lib/data/227
CHANGED
Binary file
|
data/lib/data/23b
CHANGED
Binary file
|
data/lib/data/240
CHANGED
Binary file
|
data/lib/data/24c
CHANGED
Binary file
|
data/lib/data/277
CHANGED
Binary file
|
data/lib/data/27c
CHANGED
Binary file
|
data/lib/data/28e
CHANGED
Binary file
|
data/lib/data/297
CHANGED
Binary file
|
data/lib/data/2a6
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
MP
|
2
|
-
��yP���+˄��ЕG�-B���$K�&�����4�1�pN\Li�c�ot�rh��-��������)�.~z���<SS;�kBۘ�e U�W�@�>+�] b����0x
|
1
|
+
MP�n1<�g�i���i��J��惕�bK�P�v0�a�H�X3� �(��g��pB+U0�VB�*,a��(l�a���N�Ÿ�`ܴZP�$ږ�Y�k�7��bp6���j`v.R�ޜ��/�)���Lh�
|
data/lib/data/2b1
CHANGED
Binary file
|
data/lib/data/2b3
CHANGED
Binary file
|
data/lib/data/2b5
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
�
|
2
|
-
����� Bq�b;����a+�#a!<g>%V��Z�$�/�λ���7e��5�x���}������o��F��&D��*gJ�ї�0g�e��r���ѭz���W�vR�����c ��2Ww3���W��.���PM}�<V�km��w�:�i�r�1�w�a<?�E3J�
|
1
|
+
�Q�j�0������@��ƛ�{�)����:<ʣP
|
data/lib/data/2b7
CHANGED
Binary file
|
data/lib/data/2ba
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
�P��0��[)�U
|
2
|
-
R
|
2
|
+
R;�l��M���&���I��?Cd���h���t�-;��U��J��p��Y:3�zX�����3x��'��#��)��qG���Rdk e�NԒbm7��'&{)%�6l��{���k�o�f`�
|
data/lib/data/2bb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��O�0���cMeJw�@�-�����þ�Ң�c�C�?���iD!6J�%ZR1
|
2
|
+
�s��1h�R��ņaE�[R�4i��ީ�f��)��Go<�f]\�E6���1�qy�FG�f��N���8��+��0rP����"�)|
|
data/lib/data/2c0
CHANGED
Binary file
|
data/lib/data/2c2
CHANGED
Binary file
|
data/lib/data/2c8
CHANGED
Binary file
|
data/lib/data/2c9
CHANGED
Binary file
|
data/lib/data/2cb
CHANGED
Binary file
|
data/lib/data/2cd
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
�P�
|
2
|
-
�0
|
3
|
-
jƤ/\V��LDy6��qI���Ox� BZV����*g/B�sa�*t���B�LA�N^���N�}"�;��!ףP4��Z��H�NT>�I1[��� ���چU�0��[�k��YN�%�r<[V�u:�?R�P��
|
1
|
+
�P�
|
2
|
+
�0���71��f�Q�:���{v��*0�q��n��#��m�>0��wey9����7�M��rlv)�A!��/F9k#GF^��В�Lۉ�� �i!��P�z�(�㞻3�^_����P7�㖁�H�A�>�A�Xq�� �.��ˆe�0��[�듣_���6�>[7�5��?RK���
|
data/lib/data/2d2
CHANGED
Binary file
|
data/lib/data/2d3
CHANGED
Binary file
|
data/lib/data/2ea
CHANGED
Binary file
|
data/lib/data/2eb
CHANGED
Binary file
|
data/lib/data/2f8
CHANGED
Binary file
|
data/lib/data/300
CHANGED
Binary file
|
data/lib/data/302
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
�
|
1
|
+
����0�g?M�Ti��<T�T%�@�;�V*ܐ������tIc���"�j8B=s�c�x��?fjҼ����]%�%���r���t2�c����5��)S���������j����W�C�)�7Y-6<s|�
|
2
|
+
��
|
data/lib/data/303
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
����0
|
2
|
-
�
|
1
|
+
����0��{�
|
2
|
+
��fa�`�E�x��ㄟ��+7�����s2G��T2�'G���<y�=X~���;�j���d^��mN����Ѽ>�V���h����NΓ����֮9�#�E���ɍa�W��
|
data/lib/data/304
CHANGED
Binary file
|
data/lib/data/30b
CHANGED
Binary file
|
data/lib/data/30d
CHANGED
Binary file
|
data/lib/data/30f
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�R�
|
2
|
-
|
1
|
+
�Rˎ�0<�gP��>� u������jU��� �]m$+������(k���7ǿ�Η����Q���C#�>_{`X}cT�A�/<����N$H����W���[~��ba�B�2�@�&�}��$�3�O�T;o���?.���O�H�zI��؇�.�b�H{j�,�*�H6e
|
2
|
+
�Ɩؖ���)[�h2z�H��1���N�S>�O]ǙvR{/�)h��J�¶1e?V���:���9;�(~����tY='�9�TݭKq;�r��ɲם�5!ݬ�Z���MA���b���yu}^g�y5|8�(�jz���4=�
|
data/lib/data/310
CHANGED
Binary file
|
data/lib/data/313
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
e��
|
2
|
-
�0
|
1
|
+
e��
|
2
|
+
�0��{�:Hh���M�i�A�
|
data/lib/data/314
ADDED
Binary file
|
data/lib/data/315
ADDED
Binary file
|
data/lib/data/316
ADDED
Binary file
|
data/lib/data/317
ADDED
Binary file
|
data/lib/data/318
ADDED
Binary file
|
data/lib/data/319
ADDED
Binary file
|
data/lib/data/31f
ADDED
Binary file
|
data/lib/data/320
ADDED
Binary file
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: any_ascii
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hunter WB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Unicode to ASCII transliteration. Converts Unicode characters to their
|
13
|
+
description: 'Unicode to ASCII transliteration. Converts Unicode characters to their
|
14
14
|
best ASCII representation. AnyAscii provides ASCII-only replacement strings for
|
15
15
|
practically all Unicode characters. Text is converted character-by-character without
|
16
16
|
considering the context. The mappings for each script are based on popular existing
|
@@ -18,6 +18,8 @@ description: Unicode to ASCII transliteration. Converts Unicode characters to th
|
|
18
18
|
appearance. All ASCII characters in the input are left unchanged, every other character
|
19
19
|
is replaced with printable ASCII characters. Unknown characters and some known characters
|
20
20
|
are replaced with an empty string and removed.
|
21
|
+
|
22
|
+
'
|
21
23
|
email: hunter@hunterwb.com
|
22
24
|
executables: []
|
23
25
|
extensions: []
|
@@ -275,6 +277,7 @@ files:
|
|
275
277
|
- lib/data/118
|
276
278
|
- lib/data/119
|
277
279
|
- lib/data/11a
|
280
|
+
- lib/data/11b
|
278
281
|
- lib/data/11c
|
279
282
|
- lib/data/11d
|
280
283
|
- lib/data/11e
|
@@ -340,6 +343,7 @@ files:
|
|
340
343
|
- lib/data/1e0
|
341
344
|
- lib/data/1e1
|
342
345
|
- lib/data/1e2
|
346
|
+
- lib/data/1e4
|
343
347
|
- lib/data/1e7
|
344
348
|
- lib/data/1e8
|
345
349
|
- lib/data/1e9
|
@@ -615,6 +619,14 @@ files:
|
|
615
619
|
- lib/data/311
|
616
620
|
- lib/data/312
|
617
621
|
- lib/data/313
|
622
|
+
- lib/data/314
|
623
|
+
- lib/data/315
|
624
|
+
- lib/data/316
|
625
|
+
- lib/data/317
|
626
|
+
- lib/data/318
|
627
|
+
- lib/data/319
|
628
|
+
- lib/data/31f
|
629
|
+
- lib/data/320
|
618
630
|
- lib/data/e00
|
619
631
|
homepage: https://github.com/anyascii/anyascii
|
620
632
|
licenses:
|