unicode-confusable 1.14.0 → 1.14.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +14 -24
- data/lib/unicode/confusable/constants.rb +1 -1
- data/lib/unicode/confusable.rb +5 -6
- data/scripts/benchmark.rb +7 -0
- data/unicode-confusable.gemspec +1 -0
- metadata +24 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6bc7e62b19cb936a3bc164d08264194866173ddacaff98354b3c2fc35705229
|
|
4
|
+
data.tar.gz: f5e4951ecc316d29c7c56a3355a330f9f7c9200efeb1aa6f04ee23ec96a75a15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce84aa52f44f53b94c062663ab53fbbdf7429ca00c43b32098d097996b558ecf21ac999ff9872be4b02c074285d0002f4f91193124a3b8176d19e52dfbf9b104
|
|
7
|
+
data.tar.gz: 79604e8f5dfae6d5e5a1abe1bc9757071e32ee5ff51b2e6d29df0e241e5867d831d976f67f9679656c15e47576ac54b2b47e617f5d6f9102b1e3e737efb73c4c
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -2,39 +2,29 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
unicode-confusable (1.14.0)
|
|
5
|
+
charcutter (>= 0.1.0, < 2.0)
|
|
5
6
|
|
|
6
7
|
GEM
|
|
7
8
|
remote: https://rubygems.org/
|
|
8
9
|
specs:
|
|
10
|
+
charcutter (0.1.0)
|
|
9
11
|
drb (2.2.3)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
prism (>= 1.3.0)
|
|
15
|
-
rdoc (>= 4.0.0)
|
|
16
|
-
reline (>= 0.4.2)
|
|
17
|
-
logger (1.7.0)
|
|
12
|
+
io-console (0.6.0)
|
|
13
|
+
irb (1.8.1)
|
|
14
|
+
rdoc
|
|
15
|
+
reline (>= 0.3.8)
|
|
18
16
|
minitest (6.0.6)
|
|
19
17
|
drb (~> 2.0)
|
|
20
18
|
prism (~> 1.5)
|
|
21
|
-
pp (0.6.4)
|
|
22
|
-
prettyprint
|
|
23
|
-
prettyprint (0.2.0)
|
|
24
19
|
prism (1.9.0)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
erb
|
|
32
|
-
prism (>= 1.6.0)
|
|
33
|
-
rbs (>= 4.0.0)
|
|
34
|
-
tsort
|
|
35
|
-
reline (0.7.0)
|
|
20
|
+
psych (5.1.0)
|
|
21
|
+
stringio
|
|
22
|
+
rake (13.0.6)
|
|
23
|
+
rdoc (6.5.0)
|
|
24
|
+
psych (>= 4.0.0)
|
|
25
|
+
reline (0.3.8)
|
|
36
26
|
io-console (~> 0.5)
|
|
37
|
-
|
|
27
|
+
stringio (3.0.8)
|
|
38
28
|
|
|
39
29
|
PLATFORMS
|
|
40
30
|
ruby
|
|
@@ -46,4 +36,4 @@ DEPENDENCIES
|
|
|
46
36
|
unicode-confusable!
|
|
47
37
|
|
|
48
38
|
BUNDLED WITH
|
|
49
|
-
|
|
39
|
+
2.5.17
|
data/lib/unicode/confusable.rb
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
require_relative "confusable/constants"
|
|
2
2
|
|
|
3
3
|
require 'unicode_normalize/normalize'
|
|
4
|
+
require 'charcutter'
|
|
4
5
|
|
|
5
6
|
module Unicode
|
|
6
7
|
module Confusable
|
|
7
|
-
autoload :IGNORABLE, File.expand_path('confusable/ignorable', __dir__)
|
|
8
|
-
|
|
9
8
|
def self.confusable?(string1, string2)
|
|
10
9
|
skeleton(string1) == skeleton(string2)
|
|
11
10
|
end
|
|
@@ -13,10 +12,10 @@ module Unicode
|
|
|
13
12
|
def self.skeleton(string)
|
|
14
13
|
require_relative 'confusable/index' unless defined? ::Unicode::Confusable::INDEX
|
|
15
14
|
UnicodeNormalize.normalize(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
Charcutter[
|
|
16
|
+
UnicodeNormalize.normalize(string, :nfd)
|
|
17
|
+
].deny(:ignorable).each_codepoint.map{ |codepoint|
|
|
18
|
+
INDEX[:CONFUSABLE][codepoint] || codepoint
|
|
20
19
|
}.flatten.compact.pack("U*"), :nfd
|
|
21
20
|
)
|
|
22
21
|
end
|
data/unicode-confusable.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unicode-confusable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.14.
|
|
4
|
+
version: 1.14.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Lelis
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
-
dependencies:
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: charcutter
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 0.1.0
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '2.0'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: 0.1.0
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '2.0'
|
|
12
32
|
description: "[Unicode 18.0.0] Compares two strings if they are visually confusable
|
|
13
33
|
as described in Unicode® Technical Standard #39: Both strings get transformed into
|
|
14
34
|
a skeleton format before comparing them. The skeleton is generated by normalizing
|
|
@@ -33,6 +53,7 @@ files:
|
|
|
33
53
|
- lib/unicode/confusable/ignorable.rb
|
|
34
54
|
- lib/unicode/confusable/index.rb
|
|
35
55
|
- lib/unicode/confusable/string_ext.rb
|
|
56
|
+
- scripts/benchmark.rb
|
|
36
57
|
- sig/unicode-confusable.rbs
|
|
37
58
|
- spec/unicode_confusable_spec.rb
|
|
38
59
|
- unicode-confusable.gemspec
|
|
@@ -55,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
55
76
|
- !ruby/object:Gem::Version
|
|
56
77
|
version: '0'
|
|
57
78
|
requirements: []
|
|
58
|
-
rubygems_version: 4.0.
|
|
79
|
+
rubygems_version: 4.0.10
|
|
59
80
|
specification_version: 4
|
|
60
81
|
summary: Detect characters that look visually similar.
|
|
61
82
|
test_files: []
|