slugity 1.0.1 → 1.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 12a013da57965db39a76d73b2b97c4300a704d8d
4
+ data.tar.gz: b6db44b4a4fa8e8c2bb40da92968cacb56d35f41
5
+ SHA512:
6
+ metadata.gz: bde7d289e74b46e1d572e8cdf099beaae72e518703066b433c30090c056838215cddf9a609571c3162725097ebe46a123723d7a59b7f3765e5bb052ea144e49e
7
+ data.tar.gz: 6439b3655ec8c9bec6d229054ffaac3b5b3523389fb404304d752bf12c107b54ce4537070195f17468a30fabab22c03d10442adbc8ec2ccab29434800b69a2f2
@@ -1,17 +1,16 @@
1
- require 'slugity/utilities'
2
- require 'slugity/matchers'
1
+ require_relative 'slugity/utilities'
2
+ require_relative 'slugity/matchers'
3
+ require_relative 'slugity/convert'
3
4
 
4
5
  module Slugity
5
6
 
6
- # Converts the given string into a slug
7
- #
8
- # @param string [String] the string to slugity
7
+ # Converts the given string into a slug
8
+ #
9
+ # @param string [String] the string to slugity
9
10
  # @param matcher [Symbol] the matcher to use
10
- # @return [String] the slug version of the provided string
11
+ # @return [String] the slug version of the provided string
11
12
  def slugity string, matcher=:default
12
- string = stringity(string, matcher).downcase
13
- string.gsub!( /[^a-z0-9\-\_]/, '' )
14
- return string
13
+ Slugity::Convert.slug string, matcher
15
14
  end
16
15
 
17
16
  # Converts the given string with the provided matcher
@@ -20,13 +19,7 @@ module Slugity
20
19
  # @param matcher [Symbol] the matcher to use
21
20
  # @return [String] the converted version of the provided string
22
21
  def stringity string, matcher=:default
23
- string = Util.normalize_string( string )
24
-
25
- Slugity::Matchers.use(matcher).each do |match, replacement|
26
- string.gsub!( match, replacement )
27
- end
28
-
29
- return string
22
+ Slugity::Convert.string string, matcher
30
23
  end
31
24
 
32
- end
25
+ end
@@ -0,0 +1,31 @@
1
+ module Slugity
2
+
3
+ module Convert
4
+ # Converts the given string into a slug
5
+ #
6
+ # @param string [String] the string to slugity
7
+ # @param matcher [Symbol] the matcher to use
8
+ # @return [String] the slug version of the provided string
9
+ def self.slug string, matcher=:default
10
+ string = Slugity::Convert.string( string, matcher ).downcase
11
+ string.gsub!( /[^a-z0-9\-\_]/, '' )
12
+ return string
13
+ end
14
+
15
+ # Converts the given string with the provided matcher
16
+ #
17
+ # @param string [String]
18
+ # @param matcher [Symbol] the matcher to use
19
+ # @return [String] the converted version of the provided string
20
+ def self.string string, matcher=:default
21
+ string = Util.normalize_string( string )
22
+
23
+ Slugity::Matchers.use(matcher).each do |match, replacement|
24
+ string.gsub!( match, replacement )
25
+ end
26
+
27
+ return string
28
+ end
29
+ end
30
+
31
+ end
@@ -1,13 +1,13 @@
1
1
  require 'slugity'
2
2
 
3
3
  class String
4
- include Slugity
4
+ include Slugity
5
5
 
6
6
  # call slugity on self
7
7
  # @param key [Symbol] the matcher to use
8
8
  # @return [String] the slugged string
9
- def to_slug key=:default
10
- slugity self, key
11
- end
9
+ def to_slug key=:default
10
+ slugity self, key
11
+ end
12
12
 
13
- end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require 'slugity/matchers/default'
2
+ require_relative 'matchers/default'
3
3
 
4
4
  module Slugity
5
5
  module Matchers
@@ -26,4 +26,4 @@ module Slugity
26
26
  end
27
27
 
28
28
  # add additional matchers
29
- require 'slugity/matchers/json_string'
29
+ require_relative 'matchers/json_string'
@@ -1,3 +1,3 @@
1
1
  module Slugity
2
- VERSION = '1.0.1'
3
- end
2
+ VERSION = '1.1.0'
3
+ end
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'slugity'
5
+
6
+ describe Slugity::Convert do
7
+
8
+ describe "::slug" do
9
+ it "returns a properly formatted string" do
10
+ test_strings.each do |input,output|
11
+ expect( Slugity::Convert.slug( input ) ).to eq output
12
+ end
13
+ end
14
+
15
+ it "handles non-strings like numbers" do
16
+ expect( Slugity::Convert.slug( 42 ) ).to eq "42"
17
+ expect( Slugity::Convert.slug( 123.456 ) ).to eq "123456"
18
+ end
19
+
20
+ it "strips unrecognized characters" do
21
+ expect( Slugity::Convert.slug( "a…‡†i".encode("UTF-8") ) ).to eq "ai"
22
+ end
23
+ end
24
+
25
+ describe "::string" do
26
+ it "does not strip unrecognized characters" do
27
+ expect( Slugity::Convert.string("a…‡†i".encode("UTF-8")) ).to eq "a…‡†i"
28
+ end
29
+ end
30
+
31
+ end
@@ -1,18 +1,18 @@
1
1
  require 'spec_helper'
2
- require File.expand_path("../../lib/slugity/extend_string", __FILE__)
2
+ require 'slugity/extend_string'
3
3
 
4
4
  describe String do
5
5
 
6
6
  describe "#to_slug" do
7
7
  it "should have been included on String" do
8
- "hello world".to_slug.should == "hello-world"
8
+ expect( "hello world".to_slug ).to eq "hello-world"
9
9
  end
10
10
  it "lets you pass custom matchers" do
11
11
  Slugity::Matchers.add :plus, true, {
12
12
  /\+/ => 'not-plus'
13
13
  }
14
- "one + one".to_slug(:plus).should == "one-not-plus-one"
14
+ expect( "one + one".to_slug(:plus) ).to eq "one-not-plus-one"
15
15
  end
16
16
  end
17
17
 
18
- end
18
+ end
@@ -13,8 +13,8 @@ describe ":json_string matcher" do
13
13
 
14
14
  it "correctly escapes strings" do
15
15
  test_strings.each do |input,output|
16
- stringity( input, :json_string ).should == output
16
+ expect( stringity( input, :json_string ) ).to eq output
17
17
  end
18
18
  end
19
19
 
20
- end
20
+ end
@@ -7,7 +7,7 @@ describe Slugity::Matchers do
7
7
  describe '#default_matchers' do
8
8
 
9
9
  it 'returns a hash table' do
10
- Slugity::Matchers.use(:default).class.should == Hash
10
+ expect( Slugity::Matchers.use(:default).class ).to eq Hash
11
11
  end
12
12
 
13
13
  end
@@ -19,7 +19,7 @@ describe Slugity::Matchers do
19
19
  /\%/ => 'percent'
20
20
  }
21
21
 
22
- slugity( "hello 20% of the world", :percent ).should == "hello-20percent-of-the-world"
22
+ expect( slugity( "hello 20% of the world", :percent ) ).to eq "hello-20percent-of-the-world"
23
23
 
24
24
  end
25
25
 
@@ -28,8 +28,8 @@ describe Slugity::Matchers do
28
28
  /\+/ => 'not-plus'
29
29
  }
30
30
 
31
- slugity( "one + one", :plus ).should == "one-not-plus-one"
31
+ expect( slugity( "one + one", :plus ) ).to eq "one-not-plus-one"
32
32
  end
33
33
 
34
34
  end
35
- end
35
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+ require 'slugity/utilities'
3
+
4
+ describe Slugity::Util do
5
+
6
+ describe "#trim_string" do
7
+ it "removes begining and ending spaces" do
8
+ expect( Slugity::Util.trim_string( " hello world" ) ).to eq "hello world"
9
+ expect( Slugity::Util.trim_string( "hello world " ) ).to eq "hello world"
10
+ expect( Slugity::Util.trim_string( " hello world " ) ).to eq "hello world"
11
+ expect( Slugity::Util.trim_string( " hello world " ) ).to eq "hello world"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'slugity'
5
+ require 'support/accented_characters'
6
+
7
+
8
+ test_strings = {
9
+ 'ḡḡḡḡḡx' => 'gggggx'
10
+ }
11
+
12
+ describe Slugity do
13
+ include Slugity
14
+
15
+ describe "#slugity()" do
16
+ it "returns the correctly mapped character" do
17
+ accented_characters.each do |input,output|
18
+ # p "matching #{input}"
19
+ expect( slugity( input ) ).to eq output
20
+ end
21
+ end
22
+
23
+ it "correctly handles strings of characters" do
24
+ test_strings.each do |input,output|
25
+ expect( slugity( input ) ).to eq output
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'slugity'
5
+ require 'support/test_strings'
6
+
7
+ describe Slugity do
8
+ include Slugity
9
+
10
+ describe "#slugity()" do
11
+ it "returns a properly formatted string" do
12
+ test_strings.each do |input,output|
13
+ expect( slugity( input ) ).to eq output
14
+ end
15
+ end
16
+
17
+ it "handles non-strings like numbers" do
18
+ expect( slugity( 42 ) ).to eq "42"
19
+ expect( slugity( 123.456 ) ).to eq "123456"
20
+ end
21
+
22
+ it "strips unrecognized characters" do
23
+ expect( slugity( "a…‡†i".encode("UTF-8") ) ).to eq "ai"
24
+ end
25
+ end
26
+
27
+ end
@@ -9,8 +9,8 @@ describe Slugity do
9
9
 
10
10
  describe "#stringity()" do
11
11
  it "does not strip unrecognized characters" do
12
- stringity( "a…‡†i".encode("UTF-8") ).should == "a…‡†i"
12
+ expect( stringity("a…‡†i".encode("UTF-8")) ).to eq "a…‡†i"
13
13
  end
14
14
  end
15
15
 
16
- end
16
+ end
@@ -0,0 +1,888 @@
1
+ # encoding: utf-8
2
+
3
+ def accented_characters
4
+ {
5
+ '²' => '2',
6
+ '³' => '3',
7
+ '&' => 'and',
8
+ '-' => '-',
9
+ '_' => '_',
10
+ '=' => 'equals',
11
+ '+' => 'plus',
12
+ '~' => '-',
13
+ 'µ' => 'u',
14
+ 'A' => 'a',
15
+ 'B' => 'b',
16
+ 'C' => 'c',
17
+ 'D' => 'd',
18
+ 'E' => 'e',
19
+ 'F' => 'f',
20
+ 'G' => 'g',
21
+ 'H' => 'h',
22
+ 'I' => 'i',
23
+ 'J' => 'j',
24
+ 'K' => 'k',
25
+ 'L' => 'l',
26
+ 'M' => 'm',
27
+ 'N' => 'n',
28
+ 'O' => 'o',
29
+ 'P' => 'p',
30
+ 'Q' => 'q',
31
+ 'R' => 'r',
32
+ 'S' => 's',
33
+ 'T' => 't',
34
+ 'U' => 'u',
35
+ 'V' => 'v',
36
+ 'W' => 'w',
37
+ 'X' => 'x',
38
+ 'Y' => 'y',
39
+ 'Z' => 'z',
40
+ 'a' => 'a',
41
+ 'b' => 'b',
42
+ 'c' => 'c',
43
+ 'd' => 'd',
44
+ 'e' => 'e',
45
+ 'f' => 'f',
46
+ 'g' => 'g',
47
+ 'h' => 'h',
48
+ 'i' => 'i',
49
+ 'j' => 'j',
50
+ 'k' => 'k',
51
+ 'l' => 'l',
52
+ 'm' => 'm',
53
+ 'n' => 'n',
54
+ 'o' => 'o',
55
+ 'p' => 'p',
56
+ 'q' => 'q',
57
+ 'r' => 'r',
58
+ 's' => 's',
59
+ 't' => 't',
60
+ 'u' => 'u',
61
+ 'v' => 'v',
62
+ 'w' => 'w',
63
+ 'x' => 'x',
64
+ 'y' => 'y',
65
+ 'z' => 'z',
66
+ 'À' => 'a',
67
+ 'Á' => 'a',
68
+ 'Â' => 'a',
69
+ 'Ã' => 'a',
70
+ 'Ä' => 'a',
71
+ 'Å' => 'a',
72
+ 'Æ' => 'ae',
73
+ 'Ç' => 'c',
74
+ 'È' => 'e',
75
+ 'É' => 'e',
76
+ 'Ê' => 'e',
77
+ 'Ë' => 'e',
78
+ 'Ì' => 'i',
79
+ 'Í' => 'i',
80
+ 'Î' => 'i',
81
+ 'Ï' => 'i',
82
+ 'Ð' => 'd',
83
+ 'Ñ' => 'n',
84
+ 'Ò' => 'o',
85
+ 'Ó' => 'o',
86
+ 'Ô' => 'o',
87
+ 'Õ' => 'o',
88
+ 'Ö' => 'o',
89
+ '×' => 'x',
90
+ 'Ø' => 'o',
91
+ 'Ù' => 'u',
92
+ 'Ú' => 'u',
93
+ 'Û' => 'u',
94
+ 'Ü' => 'u',
95
+ 'Ý' => 'y',
96
+ 'Þ' => 'th',
97
+ 'ß' => 'ss',
98
+ 'à' => 'a',
99
+ 'á' => 'a',
100
+ 'â' => 'a',
101
+ 'ã' => 'a',
102
+ 'ä' => 'a',
103
+ 'å' => 'a',
104
+ 'æ' => 'ae',
105
+ 'ç' => 'c',
106
+ 'è' => 'e',
107
+ 'é' => 'e',
108
+ 'ê' => 'e',
109
+ 'ë' => 'e',
110
+ 'ì' => 'i',
111
+ 'í' => 'i',
112
+ 'î' => 'i',
113
+ 'ï' => 'i',
114
+ 'ð' => 'o',
115
+ 'ñ' => 'n',
116
+ 'ò' => 'o',
117
+ 'ó' => 'o',
118
+ 'ô' => 'o',
119
+ 'õ' => 'o',
120
+ 'ö' => 'o',
121
+ 'ø' => 'o',
122
+ 'ù' => 'u',
123
+ 'ú' => 'u',
124
+ 'û' => 'u',
125
+ 'ü' => 'u',
126
+ 'ý' => 'y',
127
+ 'þ' => 'th',
128
+ 'ÿ' => 'y',
129
+ 'Ā' => 'a',
130
+ 'ā' => 'a',
131
+ 'Ă' => 'a',
132
+ 'ă' => 'a',
133
+ 'Ą' => 'a',
134
+ 'ą' => 'a',
135
+ 'Ć' => 'c',
136
+ 'ć' => 'c',
137
+ 'Ĉ' => 'c',
138
+ 'ĉ' => 'c',
139
+ 'Ċ' => 'c',
140
+ 'ċ' => 'c',
141
+ 'Č' => 'c',
142
+ 'č' => 'c',
143
+ 'Ď' => 'd',
144
+ 'ď' => 'd',
145
+ 'Đ' => 'd',
146
+ 'đ' => 'd',
147
+ 'Ē' => 'e',
148
+ 'ē' => 'e',
149
+ 'Ĕ' => 'e',
150
+ 'ĕ' => 'e',
151
+ 'Ė' => 'e',
152
+ 'ė' => 'e',
153
+ 'Ę' => 'e',
154
+ 'ę' => 'e',
155
+ 'Ě' => 'e',
156
+ 'ě' => 'e',
157
+ 'Ĝ' => 'g',
158
+ 'ĝ' => 'g',
159
+ 'Ğ' => 'g',
160
+ 'ğ' => 'g',
161
+ 'Ġ' => 'g',
162
+ 'ġ' => 'g',
163
+ 'Ģ' => 'g',
164
+ 'ģ' => 'g',
165
+ 'Ĥ' => 'h',
166
+ 'ĥ' => 'h',
167
+ 'Ħ' => 'h',
168
+ 'ħ' => 'h',
169
+ 'Ĩ' => 'i',
170
+ 'ĩ' => 'i',
171
+ 'Ī' => 'i',
172
+ 'ī' => 'i',
173
+ 'Ĭ' => 'i',
174
+ 'ĭ' => 'i',
175
+ 'Į' => 'i',
176
+ 'į' => 'i',
177
+ 'İ' => 'l',
178
+ 'ı' => 'l',
179
+ 'IJ' => 'ij',
180
+ 'ij' => 'ij',
181
+ 'Ĵ' => 'j',
182
+ 'ĵ' => 'j',
183
+ 'Ķ' => 'k',
184
+ 'ķ' => 'k',
185
+ 'ĸ' => 'k',
186
+ 'Ĺ' => 'l',
187
+ 'ĺ' => 'l',
188
+ 'Ļ' => 'l',
189
+ 'ļ' => 'l',
190
+ 'Ľ' => 'l',
191
+ 'ľ' => 'l',
192
+ 'Ŀ' => 'l',
193
+ 'ŀ' => 'l',
194
+ 'Ł' => 'l',
195
+ 'ł' => 'l',
196
+ 'Ń' => 'n',
197
+ 'ń' => 'n',
198
+ 'Ņ' => 'n',
199
+ 'ņ' => 'n',
200
+ 'Ň' => 'n',
201
+ 'ň' => 'n',
202
+ 'ʼn' => 'n',
203
+ 'Ŋ' => 'n',
204
+ 'ŋ' => 'n',
205
+ 'Ō' => 'o',
206
+ 'ō' => 'o',
207
+ 'Ŏ' => 'o',
208
+ 'ŏ' => 'o',
209
+ 'Ő' => 'o',
210
+ 'ő' => 'o',
211
+ 'Œ' => 'oe',
212
+ 'œ' => 'oe',
213
+ 'Ŕ' => 'r',
214
+ 'ŕ' => 'r',
215
+ 'Ŗ' => 'r',
216
+ 'ŗ' => 'r',
217
+ 'Ř' => 'r',
218
+ 'ř' => 'r',
219
+ 'Ś' => 's',
220
+ 'ś' => 's',
221
+ 'Ŝ' => 's',
222
+ 'ŝ' => 's',
223
+ 'Ş' => 's',
224
+ 'ş' => 's',
225
+ 'Š' => 's',
226
+ 'š' => 's',
227
+ 'Ţ' => 't',
228
+ 'ţ' => 't',
229
+ 'Ť' => 't',
230
+ 'ť' => 't',
231
+ 'Ŧ' => 't',
232
+ 'ŧ' => 't',
233
+ 'Ũ' => 'u',
234
+ 'ũ' => 'u',
235
+ 'Ū' => 'u',
236
+ 'ū' => 'u',
237
+ 'Ŭ' => 'u',
238
+ 'ŭ' => 'u',
239
+ 'Ů' => 'u',
240
+ 'ů' => 'u',
241
+ 'Ű' => 'u',
242
+ 'ű' => 'u',
243
+ 'Ų' => 'u',
244
+ 'ų' => 'u',
245
+ 'Ŵ' => 'w',
246
+ 'ŵ' => 'w',
247
+ 'Ŷ' => 'y',
248
+ 'ŷ' => 'y',
249
+ 'Ÿ' => 'y',
250
+ 'Ź' => 'z',
251
+ 'ź' => 'z',
252
+ 'Ż' => 'z',
253
+ 'ż' => 'z',
254
+ 'Ž' => 'z',
255
+ 'ž' => 'z',
256
+ 'ſ' => 's',
257
+ 'ƀ' => 'b',
258
+ 'Ɓ' => 'b',
259
+ 'Ƅ' => 'b',
260
+ 'ƅ' => 'b',
261
+ 'Ƈ' => 'c',
262
+ 'ƈ' => 'c',
263
+ 'Ɖ' => 'd',
264
+ 'Ɗ' => 'd',
265
+ 'Ƌ' => 'nd',
266
+ 'ƌ' => 'nd',
267
+ 'Ɛ' => 'e',
268
+ 'Ƒ' => 'f',
269
+ 'ƒ' => 'f',
270
+ 'Ɠ' => 'g',
271
+ 'Ɩ' => 'i',
272
+ 'Ɨ' => 'i',
273
+ 'Ƙ' => 'k',
274
+ 'ƙ' => 'k',
275
+ 'Ɯ' => 'w',
276
+ 'Ɲ' => 'n',
277
+ 'ƞ' => 'n',
278
+ 'Ɵ' => 'o',
279
+ 'Ơ' => 'o',
280
+ 'ơ' => 'o',
281
+ 'Ƥ' => 'p',
282
+ 'ƥ' => 'p',
283
+ 'Ʀ' => 'r',
284
+ 'Ƨ' => 's',
285
+ 'ƨ' => 's',
286
+ 'Ʃ' => 's',
287
+ 'ƪ' => 't',
288
+ 'ƫ' => 't',
289
+ 'Ƭ' => 't',
290
+ 'ƭ' => 't',
291
+ 'Ʈ' => 't',
292
+ 'Ư' => 'u',
293
+ 'ư' => 'u',
294
+ 'Ʊ' => 'u',
295
+ 'Ʋ' => 'u',
296
+ 'Ƶ' => 'z',
297
+ 'ƶ' => 'z',
298
+ 'Ʒ' => 'z',
299
+ 'Ƽ' => 'q',
300
+ 'ƽ' => 'q',
301
+ 'DŽ' => 'dz',
302
+ 'Dž' => 'dz',
303
+ 'dž' => 'dz',
304
+ 'LJ' => 'lj',
305
+ 'Lj' => 'lj',
306
+ 'lj' => 'lj',
307
+ 'NJ' => 'nj',
308
+ 'Nj' => 'nj',
309
+ 'nj' => 'nj',
310
+ 'Ǎ' => 'a',
311
+ 'ǎ' => 'a',
312
+ 'Ǐ' => 'i',
313
+ 'ǐ' => 'i',
314
+ 'Ǒ' => 'o',
315
+ 'ǒ' => 'o',
316
+ 'Ǔ' => 'u',
317
+ 'ǔ' => 'u',
318
+ 'Ǖ' => 'u',
319
+ 'ǖ' => 'u',
320
+ 'Ǘ' => 'u',
321
+ 'ǘ' => 'u',
322
+ 'Ǚ' => 'u',
323
+ 'ǚ' => 'u',
324
+ 'Ǜ' => 'u',
325
+ 'ǜ' => 'u',
326
+ 'ǝ' => 'e',
327
+ 'Ǟ' => 'a',
328
+ 'ǟ' => 'a',
329
+ 'Ǡ' => 'a',
330
+ 'ǡ' => 'a',
331
+ 'Ǣ' => 'ae',
332
+ 'ǣ' => 'ae',
333
+ 'Ǥ' => 'g',
334
+ 'ǥ' => 'g',
335
+ 'Ǧ' => 'g',
336
+ 'ǧ' => 'g',
337
+ 'Ǩ' => 'k',
338
+ 'ǩ' => 'k',
339
+ 'Ǫ' => 'o',
340
+ 'ǫ' => 'o',
341
+ 'Ǭ' => 'o',
342
+ 'ǭ' => 'o',
343
+ 'ǰ' => 'j',
344
+ 'DZ' => 'dz',
345
+ 'Dz' => 'dz',
346
+ 'dz' => 'dz',
347
+ 'Ǵ' => 'g',
348
+ 'ǵ' => 'g',
349
+ 'Ǹ' => 'n',
350
+ 'ǹ' => 'n',
351
+ 'Ǻ' => 'a',
352
+ 'ǻ' => 'a',
353
+ 'Ǽ' => 'ae',
354
+ 'ǽ' => 'ae',
355
+ 'Ǿ' => 'o',
356
+ 'ǿ' => 'o',
357
+ 'Ȁ' => 'a',
358
+ 'ȁ' => 'a',
359
+ 'Ȃ' => 'a',
360
+ 'ȃ' => 'a',
361
+ 'Ȅ' => 'e',
362
+ 'ȅ' => 'e',
363
+ 'Ȇ' => 'e',
364
+ 'ȇ' => 'e',
365
+ 'Ȉ' => 'i',
366
+ 'ȉ' => 'i',
367
+ 'Ȋ' => 'i',
368
+ 'ȋ' => 'i',
369
+ 'Ȍ' => 'o',
370
+ 'ȍ' => 'o',
371
+ 'Ȏ' => 'o',
372
+ 'ȏ' => 'o',
373
+ 'Ȑ' => 'r',
374
+ 'ȑ' => 'r',
375
+ 'Ȓ' => 'r',
376
+ 'ȓ' => 'r',
377
+ 'Ȕ' => 'u',
378
+ 'ȕ' => 'u',
379
+ 'Ȗ' => 'u',
380
+ 'ȗ' => 'u',
381
+ 'Ș' => 's',
382
+ 'ș' => 's',
383
+ 'Ț' => 't',
384
+ 'ț' => 't',
385
+ 'Ȟ' => 'h',
386
+ 'ȟ' => 'h',
387
+ 'Ƞ' => 'n',
388
+ 'Ȥ' => 'z',
389
+ 'ȥ' => 'z',
390
+ 'Ȧ' => 'a',
391
+ 'ȧ' => 'a',
392
+ 'Ȩ' => 'e',
393
+ 'ȩ' => 'e',
394
+ 'Ȫ' => 'o',
395
+ 'ȫ' => 'o',
396
+ 'Ȭ' => 'o',
397
+ 'ȭ' => 'o',
398
+ 'Ȯ' => 'o',
399
+ 'ȯ' => 'o',
400
+ 'Ȱ' => 'o',
401
+ 'ȱ' => 'o',
402
+ 'Ȳ' => 'y',
403
+ 'ȳ' => 'y',
404
+ 'ȷ' => 'j',
405
+ 'ȸ' => 'db',
406
+ 'ȹ' => 'qp',
407
+ 'Ⱥ' => 'a',
408
+ 'Ȼ' => 'c',
409
+ 'ȼ' => 'c',
410
+ 'Ƚ' => 'l',
411
+ 'Ⱦ' => 'l',
412
+ 'ȿ' => 's',
413
+ 'ɀ' => 'z',
414
+ 'Ƀ' => 'b',
415
+ 'Ʉ' => 'u',
416
+ 'Ʌ' => 'v',
417
+ 'Ɇ' => 'e',
418
+ 'ɇ' => 'e',
419
+ 'Ɉ' => 'j',
420
+ 'ɉ' => 'j',
421
+ 'Ɋ' => 'q',
422
+ 'ɋ' => 'q',
423
+ 'Ɍ' => 'r',
424
+ 'ɍ' => 'r',
425
+ 'Ɏ' => 'y',
426
+ 'ɏ' => 'y',
427
+ 'ɑ' => 'a',
428
+ 'ɗ' => 'd',
429
+ 'ɠ' => 'g',
430
+ 'ɡ' => 'g',
431
+ 'ɢ' => 'g',
432
+ 'ɯ' => 'w',
433
+ 'ɱ' => 'm',
434
+ 'ɵ' => 'o',
435
+ 'ɶ' => 'oe',
436
+ 'ᴀ' => 'a',
437
+ 'ᴁ' => 'ae',
438
+ 'ᴂ' => 'ae',
439
+ 'ᴃ' => 'b',
440
+ 'ᴄ' => 'c',
441
+ 'ᴅ' => 'd',
442
+ 'ᴆ' => 'd',
443
+ 'ᴇ' => 'e',
444
+ 'ᴊ' => 'j',
445
+ 'ᴋ' => 'k',
446
+ 'ᴌ' => 'l',
447
+ 'ᴍ' => 'm',
448
+ 'ᴎ' => 'n',
449
+ 'ᴏ' => 'o',
450
+ 'Ḁ' => 'a',
451
+ 'ḁ' => 'a',
452
+ 'Ḃ' => 'b',
453
+ 'ḃ' => 'b',
454
+ 'Ḅ' => 'b',
455
+ 'ḅ' => 'b',
456
+ 'Ḇ' => 'b',
457
+ 'ḇ' => 'b',
458
+ 'Ḉ' => 'c',
459
+ 'ḉ' => 'c',
460
+ 'Ḋ' => 'd',
461
+ 'ḋ' => 'd',
462
+ 'Ḍ' => 'd',
463
+ 'ḍ' => 'd',
464
+ 'Ḏ' => 'd',
465
+ 'ḏ' => 'd',
466
+ 'Ḑ' => 'd',
467
+ 'ḑ' => 'd',
468
+ 'Ḓ' => 'd',
469
+ 'ḓ' => 'd',
470
+ 'Ḕ' => 'e',
471
+ 'ḕ' => 'e',
472
+ 'Ḗ' => 'e',
473
+ 'ḗ' => 'e',
474
+ 'Ḙ' => 'e',
475
+ 'ḙ' => 'e',
476
+ 'Ḛ' => 'e',
477
+ 'ḛ' => 'e',
478
+ 'Ḝ' => 'e',
479
+ 'ḝ' => 'e',
480
+ 'Ḟ' => 'f',
481
+ 'ḟ' => 'f',
482
+ 'Ḡ' => 'g',
483
+ 'ḡ' => 'g',
484
+ 'Ḣ' => 'h',
485
+ 'ḣ' => 'h',
486
+ 'Ḥ' => 'h',
487
+ 'ḥ' => 'h',
488
+ 'Ḧ' => 'h',
489
+ 'ḧ' => 'h',
490
+ 'Ḩ' => 'h',
491
+ 'ḩ' => 'h',
492
+ 'Ḫ' => 'h',
493
+ 'ḫ' => 'h',
494
+ 'Ḭ' => 'i',
495
+ 'ḭ' => 'i',
496
+ 'Ḯ' => 'i',
497
+ 'ḯ' => 'i',
498
+ 'Ḱ' => 'k',
499
+ 'ḱ' => 'k',
500
+ 'Ḳ' => 'k',
501
+ 'ḳ' => 'k',
502
+ 'Ḵ' => 'k',
503
+ 'ḵ' => 'k',
504
+ 'Ḷ' => 'l',
505
+ 'ḷ' => 'l',
506
+ 'Ḹ' => 'l',
507
+ 'ḹ' => 'l',
508
+ 'Ḻ' => 'l',
509
+ 'ḻ' => 'l',
510
+ 'Ḽ' => 'l',
511
+ 'ḽ' => 'l',
512
+ 'Ḿ' => 'm',
513
+ 'ḿ' => 'm',
514
+ 'Ṁ' => 'm',
515
+ 'ṁ' => 'm',
516
+ 'Ṃ' => 'm',
517
+ 'ṃ' => 'm',
518
+ 'Ṅ' => 'n',
519
+ 'ṅ' => 'n',
520
+ 'Ṇ' => 'n',
521
+ 'ṇ' => 'n',
522
+ 'Ṉ' => 'n',
523
+ 'ṉ' => 'n',
524
+ 'Ṋ' => 'n',
525
+ 'ṋ' => 'n',
526
+ 'Ṍ' => 'o',
527
+ 'ṍ' => 'o',
528
+ 'Ṏ' => 'o',
529
+ 'ṏ' => 'o',
530
+ 'Ṑ' => 'o',
531
+ 'ṑ' => 'o',
532
+ 'Ṓ' => 'o',
533
+ 'ṓ' => 'o',
534
+ 'Ṕ' => 'p',
535
+ 'ṕ' => 'p',
536
+ 'Ṗ' => 'p',
537
+ 'ṗ' => 'p',
538
+ 'Ṙ' => 'r',
539
+ 'ṙ' => 'r',
540
+ 'Ṛ' => 'r',
541
+ 'ṛ' => 'r',
542
+ 'Ṝ' => 'r',
543
+ 'ṝ' => 'r',
544
+ 'Ṟ' => 'r',
545
+ 'ṟ' => 'r',
546
+ 'Ṡ' => 's',
547
+ 'ṡ' => 's',
548
+ 'Ṣ' => 's',
549
+ 'ṣ' => 's',
550
+ 'Ṥ' => 's',
551
+ 'ṥ' => 's',
552
+ 'Ṧ' => 's',
553
+ 'ṧ' => 's',
554
+ 'Ṩ' => 's',
555
+ 'ṩ' => 's',
556
+ 'Ṫ' => 't',
557
+ 'ṫ' => 't',
558
+ 'Ṭ' => 't',
559
+ 'ṭ' => 't',
560
+ 'Ṯ' => 't',
561
+ 'ṯ' => 't',
562
+ 'Ṱ' => 't',
563
+ 'ṱ' => 't',
564
+ 'Ṳ' => 'u',
565
+ 'ṳ' => 'u',
566
+ 'Ṵ' => 'u',
567
+ 'ṵ' => 'u',
568
+ 'Ṷ' => 'u',
569
+ 'ṷ' => 'u',
570
+ 'Ṹ' => 'u',
571
+ 'ṹ' => 'u',
572
+ 'Ṻ' => 'u',
573
+ 'ṻ' => 'u',
574
+ 'Ṽ' => 'v',
575
+ 'ṽ' => 'v',
576
+ 'Ṿ' => 'v',
577
+ 'ṿ' => 'v',
578
+ 'Ẁ' => 'w',
579
+ 'ẁ' => 'w',
580
+ 'Ẃ' => 'w',
581
+ 'ẃ' => 'w',
582
+ 'Ẅ' => 'w',
583
+ 'ẅ' => 'w',
584
+ 'Ẇ' => 'w',
585
+ 'ẇ' => 'w',
586
+ 'Ẉ' => 'w',
587
+ 'ẉ' => 'w',
588
+ 'Ẋ' => 'x',
589
+ 'ẋ' => 'x',
590
+ 'Ẍ' => 'x',
591
+ 'ẍ' => 'x',
592
+ 'Ẏ' => 'y',
593
+ 'ẏ' => 'y',
594
+ 'Ẑ' => 'z',
595
+ 'ẑ' => 'z',
596
+ 'Ẓ' => 'z',
597
+ 'ẓ' => 'z',
598
+ 'Ẕ' => 'z',
599
+ 'ẕ' => 'z',
600
+ 'ẖ' => 'h',
601
+ 'ẗ' => 't',
602
+ 'ẘ' => 'w',
603
+ 'ẙ' => 'y',
604
+ 'ẚ' => 'a',
605
+ 'Ạ' => 'a',
606
+ 'ạ' => 'a',
607
+ 'Ả' => 'a',
608
+ 'ả' => 'a',
609
+ 'Ấ' => 'a',
610
+ 'ấ' => 'a',
611
+ 'Ầ' => 'a',
612
+ 'ầ' => 'a',
613
+ 'Ẩ' => 'a',
614
+ 'ẩ' => 'a',
615
+ 'Ẫ' => 'a',
616
+ 'ẫ' => 'a',
617
+ 'Ậ' => 'a',
618
+ 'ậ' => 'a',
619
+ 'Ắ' => 'a',
620
+ 'ắ' => 'a',
621
+ 'Ằ' => 'a',
622
+ 'ằ' => 'a',
623
+ 'Ẳ' => 'a',
624
+ 'ẳ' => 'a',
625
+ 'Ẵ' => 'a',
626
+ 'ẵ' => 'a',
627
+ 'Ặ' => 'a',
628
+ 'ặ' => 'a',
629
+ 'Ẹ' => 'e',
630
+ 'ẹ' => 'e',
631
+ 'Ẻ' => 'e',
632
+ 'ẻ' => 'e',
633
+ 'Ẽ' => 'e',
634
+ 'ẽ' => 'e',
635
+ 'Ế' => 'e',
636
+ 'ế' => 'e',
637
+ 'Ề' => 'e',
638
+ 'ề' => 'e',
639
+ 'Ể' => 'e',
640
+ 'ể' => 'e',
641
+ 'Ễ' => 'e',
642
+ 'ễ' => 'e',
643
+ 'Ệ' => 'e',
644
+ 'ệ' => 'e',
645
+ 'Ọ' => 'o',
646
+ 'ọ' => 'o',
647
+ 'Ỏ' => 'o',
648
+ 'ỏ' => 'o',
649
+ 'Ố' => 'o',
650
+ 'ố' => 'o',
651
+ 'Ồ' => 'o',
652
+ 'ồ' => 'o',
653
+ 'Ổ' => 'o',
654
+ 'ổ' => 'o',
655
+ 'Ỗ' => 'o',
656
+ 'ỗ' => 'o',
657
+ 'Ộ' => 'o',
658
+ 'ộ' => 'o',
659
+ 'Ớ' => 'o',
660
+ 'ớ' => 'o',
661
+ 'Ờ' => 'o',
662
+ 'ờ' => 'o',
663
+ 'Ở' => 'o',
664
+ 'ở' => 'o',
665
+ 'Ỡ' => 'o',
666
+ 'ỡ' => 'o',
667
+ 'Ợ' => 'o',
668
+ 'ợ' => 'o',
669
+ 'Ụ' => 'u',
670
+ 'ụ' => 'u',
671
+ 'Ủ' => 'u',
672
+ 'ủ' => 'u',
673
+ 'Ứ' => 'u',
674
+ 'ứ' => 'u',
675
+ 'Ừ' => 'u',
676
+ 'ừ' => 'u',
677
+ 'Ử' => 'u',
678
+ 'ử' => 'u',
679
+ 'Ữ' => 'u',
680
+ 'ữ' => 'u',
681
+ 'Ự' => 'u',
682
+ 'ự' => 'u',
683
+ 'Ỳ' => 'y',
684
+ 'ỳ' => 'y',
685
+ 'Ỵ' => 'y',
686
+ 'ỵ' => 'y',
687
+ 'Ỷ' => 'y',
688
+ 'ỷ' => 'y',
689
+ 'Ỹ' => 'y',
690
+ 'ỹ' => 'y',
691
+ 'ₐ' => 'a',
692
+ 'ₑ' => 'e',
693
+ 'ₒ' => 'o',
694
+ 'ₓ' => 'x',
695
+ '℀' => 'ac',
696
+ '℁' => 'as',
697
+ 'ℂ' => 'c',
698
+ '℃' => 'c',
699
+ '℄' => 'c',
700
+ '℅' => 'co',
701
+ '℆' => 'cu',
702
+ '℉' => 'f',
703
+ 'ℊ' => 'g',
704
+ 'ℋ' => 'h',
705
+ 'ℌ' => 'h',
706
+ 'ℍ' => 'h',
707
+ 'ℎ' => 'h',
708
+ 'ℏ' => 'h',
709
+ 'ℕ' => 'n',
710
+ '℗' => 'p',
711
+ 'ℙ' => 'p',
712
+ 'ℚ' => 'q',
713
+ 'ℛ' => 'r',
714
+ 'ℜ' => 'r',
715
+ 'ℝ' => 'r',
716
+ '℞' => 'px',
717
+ '℟' => 'r',
718
+ '℠' => 'sm',
719
+ '℡' => 'tel',
720
+ '™' => 'tm',
721
+ 'ℤ' => 'z',
722
+ 'K' => 'k',
723
+ 'Å' => 'a',
724
+ 'ℬ' => 'b',
725
+ '℮' => 'e',
726
+ 'ℯ' => 'e',
727
+ '⒐' => '9',
728
+ '⒑' => '10',
729
+ '⒒' => '11',
730
+ '⒓' => '12',
731
+ '⒔' => '13',
732
+ '⒕' => '14',
733
+ '⒖' => '15',
734
+ '⒗' => '16',
735
+ '⒘' => '17',
736
+ '⒙' => '18',
737
+ '⒚' => '19',
738
+ '⒛' => '20',
739
+ '⒜' => 'a',
740
+ '⒝' => 'b',
741
+ '⒞' => 'c',
742
+ '⒟' => 'd',
743
+ '⒠' => 'e',
744
+ '⒡' => 'f',
745
+ '⒢' => 'g',
746
+ '⒣' => 'h',
747
+ '⒤' => 'i',
748
+ '⒥' => 'j',
749
+ '⒦' => 'k',
750
+ '⒧' => 'l',
751
+ '⒨' => 'm',
752
+ '⒩' => 'n',
753
+ '⒪' => 'o',
754
+ '⒫' => 'p',
755
+ '⒬' => 'q',
756
+ '⒭' => 'r',
757
+ '⒮' => 's',
758
+ '⒯' => 't',
759
+ '⒰' => 'u',
760
+ '⒱' => 'v',
761
+ '⒲' => 'w',
762
+ '⒳' => 'x',
763
+ '⒴' => 'y',
764
+ '⒵' => 'z',
765
+ 'Ⓐ' => 'a',
766
+ 'Ⓑ' => 'b',
767
+ 'Ⓒ' => 'c',
768
+ 'Ⓓ' => 'd',
769
+ 'Ⓔ' => 'e',
770
+ 'Ⓕ' => 'f',
771
+ 'Ⓖ' => 'g',
772
+ 'Ⓗ' => 'h',
773
+ 'Ⓘ' => 'i',
774
+ 'Ⓙ' => 'j',
775
+ 'Ⓚ' => 'k',
776
+ 'Ⓛ' => 'l',
777
+ 'Ⓜ' => 'm',
778
+ 'Ⓝ' => 'n',
779
+ 'Ⓞ' => 'o',
780
+ 'Ⓟ' => 'p',
781
+ 'Ⓠ' => 'q',
782
+ 'Ⓡ' => 'r',
783
+ 'Ⓢ' => 's',
784
+ 'Ⓣ' => 't',
785
+ 'Ⓤ' => 'u',
786
+ 'Ⓥ' => 'v',
787
+ 'Ⓦ' => 'w',
788
+ 'Ⓧ' => 'x',
789
+ 'Ⓨ' => 'y',
790
+ 'Ⓩ' => 'z',
791
+ 'ⓐ' => 'a',
792
+ 'ⓑ' => 'b',
793
+ 'ⓒ' => 'c',
794
+ 'ⓓ' => 'd',
795
+ 'ⓔ' => 'e',
796
+ 'ⓕ' => 'f',
797
+ 'ⓖ' => 'g',
798
+ 'ⓗ' => 'h',
799
+ 'ⓘ' => 'i',
800
+ 'ⓙ' => 'j',
801
+ 'ⓚ' => 'k',
802
+ 'ⓛ' => 'l',
803
+ 'ⓜ' => 'm',
804
+ 'ⓝ' => 'n',
805
+ 'ⓞ' => 'o',
806
+ 'ⓟ' => 'p',
807
+ 'ⓠ' => 'q',
808
+ 'ⓡ' => 'r',
809
+ 'ⓢ' => 's',
810
+ 'ⓣ' => 't',
811
+ 'ⓤ' => 'u',
812
+ 'ⓥ' => 'v',
813
+ 'ⓦ' => 'w',
814
+ 'ⓧ' => 'x',
815
+ 'ⓨ' => 'y',
816
+ 'ⓩ' => 'z',
817
+ '⓪' => '0',
818
+ 'ꜰ' => 'f',
819
+ 'ꜱ' => 's',
820
+ 'Ꜳ' => 'aa',
821
+ 'ꜳ' => 'aa',
822
+ 'Ꜵ' => 'ao',
823
+ 'ꜵ' => 'ao',
824
+ 'Ꜷ' => 'aj',
825
+ 'ꜷ' => 'aj',
826
+ 'Ꜹ' => 'av',
827
+ 'ꜹ' => 'av',
828
+ 'Ꜻ' => 'af',
829
+ 'ꜻ' => 'af',
830
+ 'Ꜽ' => 'af',
831
+ 'ꜽ' => 'af',
832
+ 'A' => 'a',
833
+ 'B' => 'b',
834
+ 'C' => 'c',
835
+ 'D' => 'd',
836
+ 'E' => 'e',
837
+ 'F' => 'f',
838
+ 'G' => 'g',
839
+ 'H' => 'h',
840
+ 'I' => 'i',
841
+ 'J' => 'j',
842
+ 'K' => 'k',
843
+ 'L' => 'l',
844
+ 'M' => 'm',
845
+ 'N' => 'n',
846
+ 'O' => 'o',
847
+ 'P' => 'p',
848
+ 'Q' => 'q',
849
+ 'R' => 'r',
850
+ 'S' => 's',
851
+ 'T' => 't',
852
+ 'U' => 'u',
853
+ 'V' => 'v',
854
+ 'W' => 'w',
855
+ 'X' => 'x',
856
+ 'Y' => 'y',
857
+ 'Z' => 'z',
858
+ '_' => '_',
859
+ 'a' => 'a',
860
+ 'b' => 'b',
861
+ 'c' => 'c',
862
+ 'd' => 'd',
863
+ 'e' => 'e',
864
+ 'f' => 'f',
865
+ 'g' => 'g',
866
+ 'h' => 'h',
867
+ 'i' => 'i',
868
+ 'j' => 'j',
869
+ 'k' => 'k',
870
+ 'l' => 'l',
871
+ 'm' => 'm',
872
+ 'n' => 'n',
873
+ 'o' => 'o',
874
+ 'p' => 'p',
875
+ 'q' => 'q',
876
+ 'r' => 'r',
877
+ 's' => 's',
878
+ 't' => 't',
879
+ 'u' => 'u',
880
+ 'v' => 'v',
881
+ 'w' => 'w',
882
+ 'x' => 'x',
883
+ 'y' => 'y',
884
+ 'z' => 'z',
885
+ '~' => '-',
886
+ 'ẞ' => 'b'
887
+ }
888
+ end