unicode-confusable 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +3 -3
- data/data/confusable.marshal.gz +0 -0
- data/lib/unicode/confusable/constants.rb +2 -2
- data/lib/unicode/confusable/index.rb +9 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff7ca55c41e0ea741c409a0e98b1be63aa12b128788a04f52452dbe38a3d02a3
|
4
|
+
data.tar.gz: 8b674ed826c9199f65b39daaeb5187c85e8511066c44f513c80e24f6bb6bdb04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b29f5ece2f51581ff30c366f046052597a33289e2db8707d0675e12e48a747cf6cea0e4eeebac4ee41a433bccb435d395272eeff0363aad3f5ecbd67f0463ad
|
7
|
+
data.tar.gz: a6b478be06b68db144fe3ad219bf994c0e30d67bef5a56791df0f017836d2570c1023e34a642869f6b5a83bf0d902e68c98c89f8072bb6c9ed934e3dbfa7c313
|
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Compares two strings if they are visually confusable as described in [Unicode® Technical Standard #39](http://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)), replacing [confusable characters](ftp://ftp.unicode.org/Public/security/10.0.0/confusables.txt), and normalizing the string again.
|
4
4
|
|
5
|
-
Unicode version: **
|
5
|
+
Unicode version: **11.0.0**
|
6
6
|
|
7
7
|
Supported Rubies: **2.5**, **2.4**, **2.3**
|
8
8
|
|
@@ -33,7 +33,7 @@ Unicode::Confusable.skeleton "ℜ𝘂ᖯʏ" # => "Ruby"
|
|
33
33
|
|
34
34
|
### List
|
35
35
|
|
36
|
-
List all confusables of
|
36
|
+
List all confusables of specific character:
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
Unicode::Confusable.list("o", false)
|
@@ -61,5 +61,5 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
61
61
|
|
62
62
|
## MIT License
|
63
63
|
|
64
|
-
- Copyright (C) 2016-
|
64
|
+
- Copyright (C) 2016-2018 Jan Lelis <http://janlelis.com>. Released under the MIT license.
|
65
65
|
- Unicode data: http://www.unicode.org/copyright.html#Exhibit1
|
data/data/confusable.marshal.gz
CHANGED
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Unicode
|
2
2
|
module Confusable
|
3
|
-
VERSION = "1.
|
4
|
-
UNICODE_VERSION = "
|
3
|
+
VERSION = "1.4.0".freeze
|
4
|
+
UNICODE_VERSION = "11.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
|
7
7
|
end
|
@@ -1,8 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "zlib"
|
4
|
+
require_relative "constants"
|
3
5
|
|
4
6
|
module Unicode
|
5
7
|
module Confusable
|
6
|
-
|
8
|
+
File.open(INDEX_FILENAME, "rb") do |file|
|
9
|
+
serialized_data = Zlib::GzipReader.new(file).read
|
10
|
+
serialized_data.force_encoding Encoding::BINARY
|
11
|
+
INDEX = Marshal.load(serialized_data)
|
12
|
+
end
|
7
13
|
end
|
8
14
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-confusable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Unicode
|
13
|
+
description: "[Unicode 11.0.0] Compares two strings if they are visually confusable
|
14
14
|
as described in Unicode® Technical Standard #39: Both strings get transformed into
|
15
15
|
a skeleton format before comparing them. The skeleton is generated by normalizing
|
16
16
|
the string, replacing confusable characters, and normalizing the string again."
|