unicode-sequence_name 1.14.0 โ 1.15.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 +10 -0
- data/Gemfile.lock +11 -11
- data/README.md +7 -2
- data/data/sequence_name.marshal.gz +0 -0
- data/lib/unicode/sequence_name/constants.rb +1 -1
- data/lib/unicode/sequence_name.rb +11 -1
- data/spec/unicode_sequence_name_spec.rb +21 -1
- 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: 4f82b600e2dee51ced0f09804f15738ccbf649f9b514795e1d30d4689c53bda3
|
4
|
+
data.tar.gz: cf50ae70515d8d772eb485f93452a3abdd07218adac8a4c8bfcc8c166fe4803b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb6701614c710ab7abf71bd8a2a2dc6c96a0fffb777d36ba47e2951bfe76b2259eb35f473c1496ffc19544d40cea015728747926e531a33fc881b12a96ee8ac2
|
7
|
+
data.tar.gz: 8941fe7b817418e6792715340bfefd7d803ae89a9704a5bd51b830e3e31777975b5c4b52851da5d127ac4b8d379f0c671452ae5efbbd52b27ef23e069b024247
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## CHANGELOG
|
2
2
|
|
3
|
+
### 1.15.0
|
4
|
+
|
5
|
+
- Include Emoji sequences which are not fully qualified (VS16 is missing) in index
|
6
|
+
- You can use the newly introduced method `Unicode::SequenceName.fully_qualified`
|
7
|
+
if you want to exclude non-fully qualified sequences
|
8
|
+
|
9
|
+
### 1.14.1
|
10
|
+
|
11
|
+
- Fix bug that some singleton Emoji would be included in index
|
12
|
+
|
3
13
|
### 1.14.0
|
4
14
|
|
5
15
|
- Unicode 16.0
|
data/Gemfile.lock
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unicode-sequence_name (1.
|
4
|
+
unicode-sequence_name (1.15.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
io-console (0.
|
10
|
-
irb (1.
|
11
|
-
rdoc
|
12
|
-
reline (>= 0.
|
13
|
-
minitest (5.
|
14
|
-
psych (5.1.
|
9
|
+
io-console (0.7.2)
|
10
|
+
irb (1.14.1)
|
11
|
+
rdoc (>= 4.0.0)
|
12
|
+
reline (>= 0.4.2)
|
13
|
+
minitest (5.25.1)
|
14
|
+
psych (5.1.2)
|
15
15
|
stringio
|
16
|
-
rake (13.
|
17
|
-
rdoc (6.
|
16
|
+
rake (13.2.1)
|
17
|
+
rdoc (6.7.0)
|
18
18
|
psych (>= 4.0.0)
|
19
|
-
reline (0.
|
19
|
+
reline (0.5.10)
|
20
20
|
io-console (~> 0.5)
|
21
|
-
stringio (3.
|
21
|
+
stringio (3.1.1)
|
22
22
|
|
23
23
|
PLATFORMS
|
24
24
|
ruby
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ IVD version: **2022-09-13** (September 2022)
|
|
10
10
|
|
11
11
|
Supported Rubies: **3.3**, **3.2**, **3.1**, **3.0**
|
12
12
|
|
13
|
-
Old Rubies which might still work: **2.
|
13
|
+
Old Rubies which might still work: **2.X**
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
@@ -32,12 +32,17 @@ Unicode::SequenceName.of "๐โโ๏ธ" # => "HEAD SHAKING HORIZONTALLY"
|
|
32
32
|
Unicode::SequenceName.of "โ๏ธ" # => "LEFT SINGLE QUOTATION MARK (right-justified fullwidth form)"
|
33
33
|
```
|
34
34
|
|
35
|
-
Names for singular codepoints are not included, you can use [unicode-name](https://github.com/janlelis/unicode-name) for that purpose.
|
35
|
+
Names for singular codepoints are not included, but you can use [unicode-name](https://github.com/janlelis/unicode-name) for that purpose. This is how you could use both libraries together to get the most relevant name of a character:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
name = Unicode::SequenceName.of(char) || Unicode::Name.readable(char)
|
39
|
+
```
|
36
40
|
|
37
41
|
## Also See
|
38
42
|
|
39
43
|
- [uniscribe](https://github.com/janlelis/uniscribe) - cli utility that makes use of unicode_sequence-name
|
40
44
|
- [unicode-x](https://github.com/janlelis/unicode-x) - more Unicode related micro libraries
|
45
|
+
- [unicode-name.js](https://github.com/janlelis/unicode-name.js) - JavaScript implementation of name and sequence_name
|
41
46
|
|
42
47
|
## MIT License
|
43
48
|
|
Binary file
|
@@ -5,7 +5,7 @@ module Unicode
|
|
5
5
|
def self.sequence_name(string)
|
6
6
|
codepoints = get_codepoint_values(string)
|
7
7
|
require_relative "sequence_name/index" unless defined? ::Unicode::SequenceName::INDEX
|
8
|
-
if res = INDEX[codepoints]
|
8
|
+
if res = INDEX[:SEQUENCES][codepoints] || INDEX[:SEQUENCES_NOT_QUALIFIED][codepoints]
|
9
9
|
res
|
10
10
|
else
|
11
11
|
nil
|
@@ -13,6 +13,16 @@ module Unicode
|
|
13
13
|
end
|
14
14
|
class << self; alias of sequence_name; end
|
15
15
|
|
16
|
+
def self.fully_qualified(string)
|
17
|
+
codepoints = get_codepoint_values(string)
|
18
|
+
require_relative "sequence_name/index" unless defined? ::Unicode::SequenceName::INDEX
|
19
|
+
if res = INDEX[:SEQUENCES][codepoints]
|
20
|
+
res
|
21
|
+
else
|
22
|
+
nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
16
26
|
def self.get_codepoint_values(string)
|
17
27
|
if string.valid_encoding?
|
18
28
|
return string.codepoints
|
@@ -3,7 +3,7 @@ require "minitest/autorun"
|
|
3
3
|
|
4
4
|
describe Unicode::SequenceName do
|
5
5
|
describe ".sequence_name (alias .of)" do
|
6
|
-
it "will return name for that sequence
|
6
|
+
it "will return name for that sequence" do
|
7
7
|
assert_equal "DOUBLE EXCLAMATION MARK (text style)", Unicode::SequenceName.of("โผ๏ธ")
|
8
8
|
assert_equal "CJK COMPATIBILITY IDEOGRAPH-2F81F", Unicode::SequenceName.of("ใ๏ธ")
|
9
9
|
assert_equal "MYANMAR LETTER NGA (dotted form)", Unicode::SequenceName.of("แ๏ธ")
|
@@ -19,10 +19,30 @@ describe Unicode::SequenceName do
|
|
19
19
|
assert_equal "LEFT SINGLE QUOTATION MARK (right-justified fullwidth form)", Unicode::SequenceName.of("โ๏ธ") # Unicode 16.0
|
20
20
|
end
|
21
21
|
|
22
|
+
it "will return name for that sequence (not fully qualified: VS16 missing)" do
|
23
|
+
assert_equal "COUPLE WITH HEART: WOMAN, WOMAN, DARK SKIN TONE, MEDIUM SKIN TONE", Unicode::SequenceName.of("๐ฉ๐ฟโโคโ๐ฉ๐ฝ")
|
24
|
+
assert_equal "MAN JUDGE", Unicode::SequenceName.of("๐จโโ")
|
25
|
+
assert_equal "WOMAN BOUNCING BALL", Unicode::SequenceName.of("โนโโ๏ธ") # First VS16 missing
|
26
|
+
assert_equal "WOMAN BOUNCING BALL", Unicode::SequenceName.of("โน๏ธโโ") # Second VS16 missing
|
27
|
+
end
|
28
|
+
|
22
29
|
it "will return nil for characters without name" do
|
23
30
|
assert_nil Unicode::SequenceName.of("\u{10c50}")
|
24
31
|
assert_nil Unicode::SequenceName.of("bla")
|
25
32
|
end
|
33
|
+
|
34
|
+
it "will return nil for single codepoints" do
|
35
|
+
assert_nil Unicode::SequenceName.of("โณ")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe ".fully_qualified" do
|
40
|
+
it "will *not* return name for that sequence (not fully qualified: VS16 missing)" do
|
41
|
+
assert_nil Unicode::SequenceName.fully_qualified("๐ฉ๐ฟโโคโ๐ฉ๐ฝ")
|
42
|
+
assert_nil Unicode::SequenceName.fully_qualified("๐จโโ")
|
43
|
+
assert_nil Unicode::SequenceName.fully_qualified("โนโโ๏ธ") # First VS16 missing
|
44
|
+
assert_nil Unicode::SequenceName.fully_qualified("โน๏ธโโ") # Second VS16 missing
|
45
|
+
end
|
26
46
|
end
|
27
47
|
end
|
28
48
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-sequence_name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.15.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: 2024-
|
11
|
+
date: 2024-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "[Unicode 16.0.0][Emoji 16.0] Returns the name of a Unicode code point
|
14
14
|
sequence, if one exists"
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
rubygems_version: 3.5.
|
56
|
+
rubygems_version: 3.5.21
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Returns the name of a Unicode codepoint sequence, if one exists
|