unicode-sequence_name 1.15.0 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f82b600e2dee51ced0f09804f15738ccbf649f9b514795e1d30d4689c53bda3
4
- data.tar.gz: cf50ae70515d8d772eb485f93452a3abdd07218adac8a4c8bfcc8c166fe4803b
3
+ metadata.gz: 9027ebad3f5176ac6e6e554460da72a6fc2edcefa99e73027df557693f197d3a
4
+ data.tar.gz: 34ea77e121ff2ed7c88e94da43bfe78ad313b52fba516255459de01ba7027d5e
5
5
  SHA512:
6
- metadata.gz: eb6701614c710ab7abf71bd8a2a2dc6c96a0fffb777d36ba47e2951bfe76b2259eb35f473c1496ffc19544d40cea015728747926e531a33fc881b12a96ee8ac2
7
- data.tar.gz: 8941fe7b817418e6792715340bfefd7d803ae89a9704a5bd51b830e3e31777975b5c4b52851da5d127ac4b8d379f0c671452ae5efbbd52b27ef23e069b024247
6
+ metadata.gz: 537a1b631841da656b8bd8a1445791383271f6f7a2fff62c9d413e0db1780d8af1d67f98c7793ec797999985ed6d2b694741c0e101ec14899a37f5e010864fe9
7
+ data.tar.gz: f4f0943434c71e329bfa4b7c9551804ab46dc1547a629bde186c95c0aeb2087661232bc74d067dac50a03ce6d12411d1753b582c664dd76d3b547fc89d1f12d5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.15.1
4
+
5
+ - Optimize index size by substituting common words
6
+
3
7
  ### 1.15.0
4
8
 
5
9
  - Include Emoji sequences which are not fully qualified (VS16 is missing) in index
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unicode-sequence_name (1.15.0)
4
+ unicode-sequence_name (1.15.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
Binary file
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Unicode
4
4
  module SequenceName
5
- VERSION = "1.15.0"
5
+ VERSION = "1.15.1"
6
6
  UNICODE_VERSION = "16.0.0"
7
7
  EMOJI_VERSION = "16.0"
8
8
  IVD_VERSION = "2022-09-13"
@@ -6,7 +6,7 @@ module Unicode
6
6
  codepoints = get_codepoint_values(string)
7
7
  require_relative "sequence_name/index" unless defined? ::Unicode::SequenceName::INDEX
8
8
  if res = INDEX[:SEQUENCES][codepoints] || INDEX[:SEQUENCES_NOT_QUALIFIED][codepoints]
9
- res
9
+ insert_words(res)
10
10
  else
11
11
  nil
12
12
  end
@@ -17,7 +17,7 @@ module Unicode
17
17
  codepoints = get_codepoint_values(string)
18
18
  require_relative "sequence_name/index" unless defined? ::Unicode::SequenceName::INDEX
19
19
  if res = INDEX[:SEQUENCES][codepoints]
20
- res
20
+ insert_words(res)
21
21
  else
22
22
  nil
23
23
  end
@@ -36,8 +36,20 @@ module Unicode
36
36
  raise(ArgumentError, "Unicode::SequenceName.of must be given a valid string")
37
37
  end
38
38
 
39
+ def self.insert_words(raw_name)
40
+ raw_name.chars.map{ |char|
41
+ codepoint = char.ord
42
+ if codepoint < INDEX[:REPLACE_BASE]
43
+ char
44
+ else
45
+ "#{INDEX[:COMMON_WORDS][codepoint - INDEX[:REPLACE_BASE]]} "
46
+ end
47
+ }.join.chomp
48
+ end
49
+
39
50
  class << self
40
51
  private :get_codepoint_values
52
+ private :insert_words
41
53
  end
42
54
  end
43
55
  end
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.15.0
4
+ version: 1.15.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: 2024-10-06 00:00:00.000000000 Z
11
+ date: 2024-10-09 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"