unicode-confusable 1.13.0 → 1.14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +30 -14
- data/MIT-LICENSE.txt +1 -1
- data/README.md +4 -6
- data/data/confusable.marshal.gz +0 -0
- data/lib/unicode/confusable/constants.rb +2 -2
- data/spec/unicode_confusable_spec.rb +2 -2
- data/unicode-confusable.gemspec +0 -1
- metadata +5 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a846fb512f666162000fa09e91c189ca180a5da30687bfddfc326bcb30160f3
|
|
4
|
+
data.tar.gz: 4aab539e7de61de215b86077222cb684442b9d17db296a60d10a4611cff0cce0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d4987cf434226234b1e15df90484e809850e822ab528fdeb01677979e6c2b0e2e4dc82466f27cf1426d8bfcacff226ed11f5bdf45176b3b21477a5505b4f18e
|
|
7
|
+
data.tar.gz: f92279a9e7ceb667e0211eb77b16cc174500a16fadbda01d1ce770379df806fdc7dae3553ed6d8e43bfdd7ed799ca3303260972f578a6dfb3124cbb0d37b933c
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
unicode-confusable (1.
|
|
4
|
+
unicode-confusable (1.14.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
drb (2.2.3)
|
|
10
|
+
erb (6.0.7)
|
|
11
|
+
io-console (0.9.4)
|
|
12
|
+
irb (1.18.0)
|
|
13
|
+
pp (>= 0.6.0)
|
|
14
|
+
prism (>= 1.3.0)
|
|
15
|
+
rdoc (>= 4.0.0)
|
|
16
|
+
reline (>= 0.4.2)
|
|
17
|
+
logger (1.7.0)
|
|
18
|
+
minitest (6.0.6)
|
|
19
|
+
drb (~> 2.0)
|
|
20
|
+
prism (~> 1.5)
|
|
21
|
+
pp (0.6.4)
|
|
22
|
+
prettyprint
|
|
23
|
+
prettyprint (0.2.0)
|
|
24
|
+
prism (1.9.0)
|
|
25
|
+
rake (13.4.2)
|
|
26
|
+
rbs (4.2.0)
|
|
27
|
+
logger
|
|
28
|
+
prism (>= 1.6.0)
|
|
29
|
+
tsort
|
|
30
|
+
rdoc (8.0.0)
|
|
31
|
+
erb
|
|
32
|
+
prism (>= 1.6.0)
|
|
33
|
+
rbs (>= 4.0.0)
|
|
34
|
+
tsort
|
|
35
|
+
reline (0.7.0)
|
|
20
36
|
io-console (~> 0.5)
|
|
21
|
-
|
|
37
|
+
tsort (0.2.0)
|
|
22
38
|
|
|
23
39
|
PLATFORMS
|
|
24
40
|
ruby
|
|
@@ -30,4 +46,4 @@ DEPENDENCIES
|
|
|
30
46
|
unicode-confusable!
|
|
31
47
|
|
|
32
48
|
BUNDLED WITH
|
|
33
|
-
|
|
49
|
+
4.1.0.beta1
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Compares two strings if they are visually confusable as described in [Unicode® Technical Standard #39](https://www.unicode.org/reports/tr39/#Confusable_Detection): Both strings get transformed into a skeleton format before comparing them. The skeleton is generated by normalizing the string ([NFD](http://unicode.org/reports/tr15/#Norm_Forms)), removing ignorable characters, replacing [confusable characters](https://unicode.org/Public/security/16.0.0/confusables.txt), and normalizing the string again.
|
|
4
4
|
|
|
5
|
-
Unicode version: **
|
|
5
|
+
Unicode version: **18.0.0** (September 2026)
|
|
6
6
|
|
|
7
7
|
\* The Unicode normalization [depends on your Ruby version](https://idiosyncratic-ruby.com/73-unicode-version-mapping.html)
|
|
8
8
|
|
|
9
9
|
Please note: The TR39 standard now includes detection of confusables based on bidi formatting (i.e. right-to-left text). This is currently not supported by this gen.
|
|
10
10
|
|
|
11
|
-
Supported Rubies: **3.x** (might stil work: **2.x**)
|
|
12
|
-
|
|
13
11
|
## Usage
|
|
14
12
|
|
|
15
13
|
### Confusable?
|
|
@@ -39,14 +37,14 @@ List all characters that map to the confusable exemplar given:
|
|
|
39
37
|
|
|
40
38
|
```ruby
|
|
41
39
|
Unicode::Confusable.list("o", false)
|
|
42
|
-
# => ["ం", "ಂ", "ം", "ං", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "
|
|
40
|
+
# => ["ం", "ಂ", "ം", "ං", "𑌂", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "᪀", "᪐", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ᲂ", "ჿ", "օ", "ס", "ه", "𞸤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ࡀ", "ߋ", "ഠ", "ᯪ", "ဝ", "𐴇", "𑄤", "ᩅ", "𐓪", "ᄋ", "ㅇ", "ᄋ", "ᆼ", "𑣈", "𑣗", "𐤬", "𐐬"]
|
|
43
41
|
```
|
|
44
42
|
|
|
45
43
|
If you omit the second parameter, it will also show confusables, where the given character is just a part of:
|
|
46
44
|
|
|
47
45
|
```ruby
|
|
48
46
|
Unicode::Confusable.list("o")
|
|
49
|
-
# => ["⒪", "ꜵ", "℅", "ᴔ", "ꭁ", "ꭂ", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "
|
|
47
|
+
# => ["⒪", "㈇", "㈕", "㈝", "㈞", "ꜵ", "℅", "ꭃ", "ꭄ", "㏇", "ᴔ", "ꭁ", "ꭂ", "㏒", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "𑌂", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "᪀", "᪐", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ᲂ", "ჿ", "օ", "ס", "ه", "𞸤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ࡀ", "ߋ", "ഠ", "ᯪ", "ဝ", "𐴇", "𑄤", "ᩅ", "𐓪", "ᄋ", "ㅇ", "ᄋ", "ᆼ", "𑣈", "𑣗", "𐤬", "𐐬", "ۿ", "ة", "ﺔ", "ﺓ", "ۃ", "ø", "ꬾ", "ꚢ", "ɵ", "ꝋ", "ⲑ", "ө", "ѳ", "ꮎ", "ꮻ", "ꭴ", "ﮥ", "ﮤ", "ﳙ", "œ", "ɶ", "\u{1DF5E}", "𞹤", "∞", "ꝏ", "ꚙ", "ᅇ", "ㆀ", "ᇮ", "\u{1DF5F}", "㍵", "ѹ", "ﳗ", "ﱑ", "ﳘ", "ﱒ", "ﶓ", "ﶔ", "ﱓ", "ﱔ", "ൟ", "თ", "တ", "𑄖", "ᨲ", "ᅁ", "ᇬ", "ᇭ", "ᅂ", "ꥶ", "ᅃ", "ᅄ", "ᅅ", "ᇱ", "ㆂ", "ᅈ", "ᅉ", "ᇯ", "ᅊ", "ᅋ", "ꥷ", "ᅆ", "ᇲ", "ㆃ", "㏖", "ꭣ", "ﲠ", "ﳢ", "ﲥ", "ﳤ", "ﷻ", "𞱵", "ﴱ", "ﳨ", "ﴲ", "ﳪ", "ﷺ", "𞲱", "ﷷ", "𞲣", "ﳍ", "𞲟", "𞲞", "ﳖ", "ﳯ", "ﳞ", "ﳱ", "ﳦ", "ﲛ", "ﳠ", "ﯭ", "ﯬ", "ᄛ", "ퟝ", "ꥫ", "ᇕ", "ᄝ", "ㅱ", "ᇢ", "ᄫ", "ㅸ", "ᇦ", "ᄬ", "ㅹ", "ᄵ", "ퟫ", "ᅍ", "ᅗ", "ㆄ", "ᇴ", "ퟴ"]
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
## No Bidi-Confusable Check
|
|
@@ -61,5 +59,5 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
|
61
59
|
|
|
62
60
|
## MIT License
|
|
63
61
|
|
|
64
|
-
- Copyright (C) 2016-
|
|
62
|
+
- Copyright (C) 2016-2026 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
|
65
63
|
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
data/data/confusable.marshal.gz
CHANGED
|
Binary file
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Unicode
|
|
4
4
|
module Confusable
|
|
5
|
-
VERSION = "1.
|
|
6
|
-
UNICODE_VERSION = "
|
|
5
|
+
VERSION = "1.14.0"
|
|
6
|
+
UNICODE_VERSION = "18.0.0"
|
|
7
7
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
|
|
8
8
|
INDEX_FILENAME = (DATA_DIRECTORY + "/confusable.marshal.gz").freeze
|
|
9
9
|
end
|
|
@@ -28,13 +28,13 @@ describe Unicode::Confusable do
|
|
|
28
28
|
|
|
29
29
|
describe ".list(char)" do
|
|
30
30
|
it "will return list of confusables for a character, also confusables where given character is part of" do
|
|
31
|
-
assert_equal ["⒪", "ꜵ", "℅", "ᴔ", "ꭁ", "ꭂ", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "
|
|
31
|
+
assert_equal ["⒪", "㈇", "㈕", "㈝", "㈞", "ꜵ", "℅", "ꭃ", "ꭄ", "㏇", "ᴔ", "ꭁ", "ꭂ", "㏒", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "𑌂", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "᪀", "᪐", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ᲂ", "ჿ", "օ", "ס", "ه", "𞸤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ࡀ", "ߋ", "ഠ", "ᯪ", "ဝ", "𐴇", "𑄤", "ᩅ", "𐓪", "ᄋ", "ㅇ", "ᄋ", "ᆼ", "𑣈", "𑣗", "𐤬", "𐐬", "ۿ", "ة", "ﺔ", "ﺓ", "ۃ", "ø", "ꬾ", "ꚢ", "ɵ", "ꝋ", "ⲑ", "ө", "ѳ", "ꮎ", "ꮻ", "ꭴ", "ﮥ", "ﮤ", "ﳙ", "œ", "ɶ", "\u{1DF5E}", "𞹤", "∞", "ꝏ", "ꚙ", "ᅇ", "ㆀ", "ᇮ", "\u{1DF5F}", "㍵", "ѹ", "ﳗ", "ﱑ", "ﳘ", "ﱒ", "ﶓ", "ﶔ", "ﱓ", "ﱔ", "ൟ", "თ", "တ", "𑄖", "ᨲ", "ᅁ", "ᇬ", "ᇭ", "ᅂ", "ꥶ", "ᅃ", "ᅄ", "ᅅ", "ᇱ", "ㆂ", "ᅈ", "ᅉ", "ᇯ", "ᅊ", "ᅋ", "ꥷ", "ᅆ", "ᇲ", "ㆃ", "㏖", "ꭣ", "ﲠ", "ﳢ", "ﲥ", "ﳤ", "ﷻ", "𞱵", "ﴱ", "ﳨ", "ﴲ", "ﳪ", "ﷺ", "𞲱", "ﷷ", "𞲣", "ﳍ", "𞲟", "𞲞", "ﳖ", "ﳯ", "ﳞ", "ﳱ", "ﳦ", "ﲛ", "ﳠ", "ﯭ", "ﯬ", "ᄛ", "ퟝ", "ꥫ", "ᇕ", "ᄝ", "ㅱ", "ᇢ", "ᄫ", "ㅸ", "ᇦ", "ᄬ", "ㅹ", "ᄵ", "ퟫ", "ᅍ", "ᅗ", "ㆄ", "ᇴ", "ퟴ"], Unicode::Confusable.list("o")
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
describe ".list(char, false)" do
|
|
36
36
|
it "will return list of confusables for a character, only direct confusables" do
|
|
37
|
-
assert_equal ["ం", "ಂ", "ം", "ං", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "
|
|
37
|
+
assert_equal ["ం", "ಂ", "ം", "ං", "𑌂", "०", "০", "੦", "૦", "୦", "௦", "౦", "൦", "๐", "໐", "၀", "០", "᪀", "᪐", "𑓐", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "ϭ", "о", "ᲂ", "ჿ", "օ", "ס", "ه", "𞸤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ࡀ", "ߋ", "ഠ", "ᯪ", "ဝ", "𐴇", "𑄤", "ᩅ", "𐓪", "ᄋ", "ㅇ", "ᄋ", "ᆼ", "𑣈", "𑣗", "𐤬", "𐐬"], Unicode::Confusable.list("o", false)
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/unicode-confusable.gemspec
CHANGED
|
@@ -14,7 +14,6 @@ Gem::Specification.new do |gem|
|
|
|
14
14
|
|
|
15
15
|
gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ }
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
17
|
gem.require_paths = ["lib"]
|
|
19
18
|
gem.metadata = { "rubygems_mfa_required" => "true" }
|
|
20
19
|
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unicode-confusable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Lelis
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
|
-
description: "[Unicode
|
|
12
|
+
description: "[Unicode 18.0.0] Compares two strings if they are visually confusable
|
|
14
13
|
as described in Unicode® Technical Standard #39: Both strings get transformed into
|
|
15
14
|
a skeleton format before comparing them. The skeleton is generated by normalizing
|
|
16
15
|
the string, replacing confusable characters, and then normalizing the string again."
|
|
@@ -42,7 +41,6 @@ licenses:
|
|
|
42
41
|
- MIT
|
|
43
42
|
metadata:
|
|
44
43
|
rubygems_mfa_required: 'true'
|
|
45
|
-
post_install_message:
|
|
46
44
|
rdoc_options: []
|
|
47
45
|
require_paths:
|
|
48
46
|
- lib
|
|
@@ -57,9 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
57
55
|
- !ruby/object:Gem::Version
|
|
58
56
|
version: '0'
|
|
59
57
|
requirements: []
|
|
60
|
-
rubygems_version:
|
|
61
|
-
signing_key:
|
|
58
|
+
rubygems_version: 4.0.20
|
|
62
59
|
specification_version: 4
|
|
63
60
|
summary: Detect characters that look visually similar.
|
|
64
|
-
test_files:
|
|
65
|
-
- spec/unicode_confusable_spec.rb
|
|
61
|
+
test_files: []
|