unicode-confusable 1.3.0 → 1.3.1
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 +5 -5
- data/.travis.yml +5 -3
- data/CHANGELOG.md +4 -0
- data/README.md +21 -1
- data/lib/unicode/confusable/constants.rb +1 -1
- data/lib/unicode/confusable/index.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 16d2f6c3c2e193af770012c7ba5f293b2153112f693dec3cdead464048de2164
|
4
|
+
data.tar.gz: 58db50962af49521c0c9318edff3159b16b5e691d6c169a5e2eb85ae0dd95d96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a6d00a7ff4a25a2ebd6d2ed7322036004da192b39110d01bf11c891bd4601474757212b6ee2bb6b01def80cb5a44d4db0ca2bfe7b9622ff11ff237a10072366
|
7
|
+
data.tar.gz: 80934ded53c701daca4f83b1a9987dd3c27e9d85b2bd5994b7d1cfe39be4253438dd7d71e3d9e4da4c118323b38fbaaeaa238ffa1ebb937dfcb837d11449f3c9
|
data/.travis.yml
CHANGED
@@ -4,13 +4,15 @@ language: ruby
|
|
4
4
|
script: bundle exec ruby spec/unicode_confusable_spec.rb
|
5
5
|
|
6
6
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
7
|
+
- 2.5.1
|
8
|
+
- 2.4.4
|
9
|
+
- 2.3.7
|
9
10
|
- 2.2
|
10
11
|
- ruby-head
|
11
12
|
- jruby-head
|
12
|
-
- jruby-9.1.
|
13
|
+
- jruby-9.1.16.0
|
13
14
|
|
14
15
|
matrix:
|
15
16
|
allow_failures:
|
17
|
+
- rvm: 2.2
|
16
18
|
- rvm: jruby-head
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,10 +4,14 @@ Compares two strings if they are visually confusable as described in [Unicode®
|
|
4
4
|
|
5
5
|
Unicode version: **10.0.0**
|
6
6
|
|
7
|
-
Supported Rubies: **2.
|
7
|
+
Supported Rubies: **2.5**, **2.4**, **2.3**
|
8
|
+
|
9
|
+
Old Rubies that might still work: **2.2**
|
8
10
|
|
9
11
|
## Usage
|
10
12
|
|
13
|
+
### Confusable?
|
14
|
+
|
11
15
|
```ruby
|
12
16
|
require "unicode/confusable"
|
13
17
|
|
@@ -27,6 +31,22 @@ Unicode::Confusable.skeleton "ℜ𝘂ᖯʏ" # => "Ruby"
|
|
27
31
|
|
28
32
|
**Please note:** The skeleton is an intermediate representation, not meant for any other use than testing confusability, [according to the standard](http://www.unicode.org/reports/tr39/#Confusable_Detection).
|
29
33
|
|
34
|
+
### List
|
35
|
+
|
36
|
+
List all confusables of specfic character:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
Unicode::Confusable.list("o", false)
|
40
|
+
# => ["ం", "ಂ", "ം", "ං", "०", "੦", "૦", "௦", "౦", "೦", "൦", "๐", "໐", "၀", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "𞹤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ഠ", "ဝ", "𐓪", "𑣈", "𑣗", "𐐬"]
|
41
|
+
```
|
42
|
+
|
43
|
+
If you omit the second parameter, it will also show confusables, where the given character is just a part of:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
Unicode::Confusable.list("o")
|
47
|
+
# => ["⒪", "ꜵ", "℅", "ᴔ", "ꭁ", "ꭂ", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "०", "੦", "૦", "௦", "౦", "೦", "൦", "๐", "໐", "၀", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "𞹤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ഠ", "ဝ", "𐓪", "𑣈", "𑣗", "𐐬", "ۿ", "ø", "ꬾ", "ɵ", "ꝋ", "ө", "ѳ", "ꮎ", "ꮻ", "ꭴ", "ﳙ", "ơ", "œ", "ɶ", "∞", "ꝏ", "ꚙ", "ﳗ", "ﱑ", "ﳘ", "ﱒ", "ﶓ", "ﶔ", "ﱓ", "ﱔ", "ൟ", "တ", "ꭣ", "ﲠ", "ﳢ", "ﲥ", "ﳤ", "ﷻ", "ﴱ", "ﳨ", "ﴲ", "ﳪ", "ﷺ", "ﷷ", "ﳍ", "ﳖ", "ﳯ", "ﳞ", "ﳱ", "ﳦ", "ﲛ", "ﳠ", "ﯭ", "ﯬ"]
|
48
|
+
```
|
49
|
+
|
30
50
|
## No Advanced Detection
|
31
51
|
|
32
52
|
TR 39 also describes mechanisms for a more exact recognition of confusables, also within the same string:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Unicode
|
2
2
|
module Confusable
|
3
|
-
VERSION = "1.3.
|
3
|
+
VERSION = "1.3.1".freeze
|
4
4
|
UNICODE_VERSION = "10.0.0".freeze
|
5
5
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
|
6
6
|
INDEX_FILENAME = (DATA_DIRECTORY + '/confusable.marshal.gz').freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-confusable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "[Unicode 10.0.0] Compares two strings if they are visually confusable
|
14
14
|
as described in Unicode® Technical Standard #39: Both strings get transformed into
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.6
|
59
|
+
rubygems_version: 2.7.6
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Detect characters that look visually similar.
|