unicode-numeric_value 1.0.0 → 1.1.0

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
  SHA1:
3
- metadata.gz: 8a9b1163ccbb1f427bccec1be2604de0996b8873
4
- data.tar.gz: 7145738ed703e380af0afb1fafdc17156541ae24
3
+ metadata.gz: b8013a2e49c8257085a2f70a1761b19727d796bb
4
+ data.tar.gz: 66e9d03de5ae0261fa1414e1bd4c45c06e9aaf71
5
5
  SHA512:
6
- metadata.gz: 1579ac48c7498a36391612546bc02d173eef194e248ba0488a43789a4f684607a696c0299393b8fd05e5543410ff12380ca6241f25eb6deaee27bb817e6a134b
7
- data.tar.gz: 98714dd03cdb6d3e4b9c870c69db473170228532558deb1a2716ed066045292ed64c9dac3c6e1b2578e3cdec72fa949e3b7d5ba9d52a55eb8cbce4405503afea
6
+ metadata.gz: e8978b5fdeb0a5295d7e54f79ff729888255f8f0abbfc20c59209179a7d136e06c2315fe84ed467ff2dd9cff5aa0b8e2e1f17132a41f37b51c546034278dfa8c
7
+ data.tar.gz: 53a2b17e87c58e7211301a92a36943a1567415381a2a26a4a2116b5ffd070d3537a9a541f0c60ba79f368935261097acf909d176693d3d01c366c671f39ec0bf
@@ -1,6 +1,10 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.1.0
4
+
5
+ * Include numeric values from Unihan database
6
+
3
7
  ### 1.0.0
4
8
 
5
- * Inital release
9
+ * Initial release
6
10
 
data/README.md CHANGED
@@ -25,6 +25,7 @@ Unicode::NumericValue.of("⓳") # => 19
25
25
  Unicode::NumericValue.of("¾") # => (3/4)
26
26
  Unicode::NumericValue.of("༳") # => (-1/2)
27
27
  Unicode::NumericValue.of("𖭡") # => 1000000000000
28
+ Unicode::NumericValue.of("五") # => 5
28
29
  Unicode::NumericValue.of("A") # => nil
29
30
  ```
30
31
 
@@ -47,7 +48,6 @@ puts "Codepoint | Character | Numeric Value | Name\n" \
47
48
  ].join(" | ")
48
49
  }.join("\n")
49
50
  ```
50
-
51
51
  Codepoint | Character | Numeric Value | Name
52
52
  ----------|-----------|---------------|-----
53
53
  U+0030 | 0 | 0 | DIGIT ZERO
@@ -679,6 +679,64 @@ Codepoint | Character | Numeric Value | Name
679
679
  U+32BD | ㊽ | 48 | CIRCLED NUMBER FORTY EIGHT
680
680
  U+32BE | ㊾ | 49 | CIRCLED NUMBER FORTY NINE
681
681
  U+32BF | ㊿ | 50 | CIRCLED NUMBER FIFTY
682
+ U+3405 | 㐅 | 5 | CJK UNIFIED IDEOGRAPH-3405
683
+ U+3483 | 㒃 | 2 | CJK UNIFIED IDEOGRAPH-3483
684
+ U+382A | 㠪 | 5 | CJK UNIFIED IDEOGRAPH-382A
685
+ U+3B4D | 㭍 | 7 | CJK UNIFIED IDEOGRAPH-3B4D
686
+ U+4E00 | 一 | 1 | CJK UNIFIED IDEOGRAPH-4E00
687
+ U+4E03 | 七 | 7 | CJK UNIFIED IDEOGRAPH-4E03
688
+ U+4E07 | 万 | 10000 | CJK UNIFIED IDEOGRAPH-4E07
689
+ U+4E09 | 三 | 3 | CJK UNIFIED IDEOGRAPH-4E09
690
+ U+4E5D | 九 | 9 | CJK UNIFIED IDEOGRAPH-4E5D
691
+ U+4E8C | 二 | 2 | CJK UNIFIED IDEOGRAPH-4E8C
692
+ U+4E94 | 五 | 5 | CJK UNIFIED IDEOGRAPH-4E94
693
+ U+4E96 | 亖 | 4 | CJK UNIFIED IDEOGRAPH-4E96
694
+ U+4EBF | 亿 | 100000000 | CJK UNIFIED IDEOGRAPH-4EBF
695
+ U+4EC0 | 什 | 10 | CJK UNIFIED IDEOGRAPH-4EC0
696
+ U+4EDF | 仟 | 1000 | CJK UNIFIED IDEOGRAPH-4EDF
697
+ U+4EE8 | 仨 | 3 | CJK UNIFIED IDEOGRAPH-4EE8
698
+ U+4F0D | 伍 | 5 | CJK UNIFIED IDEOGRAPH-4F0D
699
+ U+4F70 | 佰 | 100 | CJK UNIFIED IDEOGRAPH-4F70
700
+ U+5104 | 億 | 100000000 | CJK UNIFIED IDEOGRAPH-5104
701
+ U+5146 | 兆 | 1000000000000 | CJK UNIFIED IDEOGRAPH-5146
702
+ U+5169 | 兩 | 2 | CJK UNIFIED IDEOGRAPH-5169
703
+ U+516B | 八 | 8 | CJK UNIFIED IDEOGRAPH-516B
704
+ U+516D | 六 | 6 | CJK UNIFIED IDEOGRAPH-516D
705
+ U+5341 | 十 | 10 | CJK UNIFIED IDEOGRAPH-5341
706
+ U+5343 | 千 | 1000 | CJK UNIFIED IDEOGRAPH-5343
707
+ U+5344 | 卄 | 20 | CJK UNIFIED IDEOGRAPH-5344
708
+ U+5345 | 卅 | 30 | CJK UNIFIED IDEOGRAPH-5345
709
+ U+534C | 卌 | 40 | CJK UNIFIED IDEOGRAPH-534C
710
+ U+53C1 | 叁 | 3 | CJK UNIFIED IDEOGRAPH-53C1
711
+ U+53C2 | 参 | 3 | CJK UNIFIED IDEOGRAPH-53C2
712
+ U+53C3 | 參 | 3 | CJK UNIFIED IDEOGRAPH-53C3
713
+ U+53C4 | 叄 | 3 | CJK UNIFIED IDEOGRAPH-53C4
714
+ U+56DB | 四 | 4 | CJK UNIFIED IDEOGRAPH-56DB
715
+ U+58F1 | 壱 | 1 | CJK UNIFIED IDEOGRAPH-58F1
716
+ U+58F9 | 壹 | 1 | CJK UNIFIED IDEOGRAPH-58F9
717
+ U+5E7A | 幺 | 1 | CJK UNIFIED IDEOGRAPH-5E7A
718
+ U+5EFE | 廾 | 9 | CJK UNIFIED IDEOGRAPH-5EFE
719
+ U+5EFF | 廿 | 20 | CJK UNIFIED IDEOGRAPH-5EFF
720
+ U+5F0C | 弌 | 1 | CJK UNIFIED IDEOGRAPH-5F0C
721
+ U+5F0D | 弍 | 2 | CJK UNIFIED IDEOGRAPH-5F0D
722
+ U+5F0E | 弎 | 3 | CJK UNIFIED IDEOGRAPH-5F0E
723
+ U+5F10 | 弐 | 2 | CJK UNIFIED IDEOGRAPH-5F10
724
+ U+62FE | 拾 | 10 | CJK UNIFIED IDEOGRAPH-62FE
725
+ U+634C | 捌 | 8 | CJK UNIFIED IDEOGRAPH-634C
726
+ U+67D2 | 柒 | 7 | CJK UNIFIED IDEOGRAPH-67D2
727
+ U+6F06 | 漆 | 7 | CJK UNIFIED IDEOGRAPH-6F06
728
+ U+7396 | 玖 | 9 | CJK UNIFIED IDEOGRAPH-7396
729
+ U+767E | 百 | 100 | CJK UNIFIED IDEOGRAPH-767E
730
+ U+8086 | 肆 | 4 | CJK UNIFIED IDEOGRAPH-8086
731
+ U+842C | 萬 | 10000 | CJK UNIFIED IDEOGRAPH-842C
732
+ U+8CAE | 貮 | 2 | CJK UNIFIED IDEOGRAPH-8CAE
733
+ U+8CB3 | 貳 | 2 | CJK UNIFIED IDEOGRAPH-8CB3
734
+ U+8D30 | 贰 | 2 | CJK UNIFIED IDEOGRAPH-8D30
735
+ U+9621 | 阡 | 1000 | CJK UNIFIED IDEOGRAPH-9621
736
+ U+9646 | 陆 | 6 | CJK UNIFIED IDEOGRAPH-9646
737
+ U+964C | 陌 | 100 | CJK UNIFIED IDEOGRAPH-964C
738
+ U+9678 | 陸 | 6 | CJK UNIFIED IDEOGRAPH-9678
739
+ U+96F6 | 零 | 0 | CJK UNIFIED IDEOGRAPH-96F6
682
740
  U+A620 | ꘠ | 0 | VAI DIGIT ZERO
683
741
  U+A621 | ꘡ | 1 | VAI DIGIT ONE
684
742
  U+A622 | ꘢ | 2 | VAI DIGIT TWO
@@ -1490,6 +1548,21 @@ Codepoint | Character | Numeric Value | Name
1490
1548
  U+1F10A | 🄊 | 9 | DIGIT NINE COMMA
1491
1549
  U+1F10B | 🄋 | 0 | DINGBAT CIRCLED SANS-SERIF DIGIT ZERO
1492
1550
  U+1F10C | 🄌 | 0 | DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ZERO
1551
+ U+20001 | 𠀁 | 7 | CJK UNIFIED IDEOGRAPH-20001
1552
+ U+20064 | 𠁤 | 4 | CJK UNIFIED IDEOGRAPH-20064
1553
+ U+200E2 | 𠃢 | 4 | CJK UNIFIED IDEOGRAPH-200E2
1554
+ U+20121 | 𠄡 | 5 | CJK UNIFIED IDEOGRAPH-20121
1555
+ U+2092A | 𠤪 | 1 | CJK UNIFIED IDEOGRAPH-2092A
1556
+ U+20983 | 𠦃 | 30 | CJK UNIFIED IDEOGRAPH-20983
1557
+ U+2098C | 𠦌 | 40 | CJK UNIFIED IDEOGRAPH-2098C
1558
+ U+2099C | 𠦜 | 40 | CJK UNIFIED IDEOGRAPH-2099C
1559
+ U+20AEA | 𠫪 | 6 | CJK UNIFIED IDEOGRAPH-20AEA
1560
+ U+20AFD | 𠫽 | 3 | CJK UNIFIED IDEOGRAPH-20AFD
1561
+ U+20B19 | 𠬙 | 3 | CJK UNIFIED IDEOGRAPH-20B19
1562
+ U+22390 | 𢎐 | 2 | CJK UNIFIED IDEOGRAPH-22390
1563
+ U+22998 | 𢦘 | 3 | CJK UNIFIED IDEOGRAPH-22998
1564
+ U+23B1B | 𣬛 | 3 | CJK UNIFIED IDEOGRAPH-23B1B
1565
+ U+2626D | 𦉭 | 4 | CJK UNIFIED IDEOGRAPH-2626D
1493
1566
  U+2F890 | 廾 | 9 | CJK COMPATIBILITY IDEOGRAPH-2F890
1494
1567
 
1495
1568
  See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related micro libraries.
@@ -12,7 +12,7 @@ module Unicode
12
12
 
13
13
  def self.chars
14
14
  require_relative "numeric_value/index" unless defined? ::Unicode::NumericValue::INDEX
15
- INDEX.keys.map{ |codepoint| [codepoint].pack("U") }
15
+ INDEX.keys.sort.map{ |codepoint| [codepoint].pack("U") }
16
16
  end
17
17
  end
18
18
  end
@@ -1,6 +1,6 @@
1
1
  module Unicode
2
2
  module NumericValue
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.1.0".freeze
4
4
  UNICODE_VERSION = "8.0.0".freeze
5
5
  DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
6
6
  INDEX_FILENAME = (DATA_DIRECTORY + '/numeric_value.marshal.gz').freeze
@@ -0,0 +1,14 @@
1
+ require_relative "lib/unicode/numeric_value"
2
+ require "unicode/name" # https://github.com/janlelis/unicode-name
3
+
4
+ puts "Codepoint | Character | Numeric Value | Name\n" \
5
+ "----------|-----------|---------------|-----\n" +
6
+ Unicode::NumericValue.chars.map{ |char|
7
+ [
8
+ format("U+%.4X", char.unpack("U")[0]).rjust(9),
9
+ char.rjust(9),
10
+ Unicode::NumericValue.of(char).inspect.rjust(13),
11
+ Unicode::Name.of(char)
12
+ ].join(" | ")
13
+ }.join("\n")
14
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-numeric_value
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.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: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "[Unicode 8.0.0] Convert a Unicode character into its numeric value."
14
14
  email:
@@ -32,6 +32,7 @@ files:
32
32
  - lib/unicode/numeric_value/index.rb
33
33
  - lib/unicode/numeric_value/string_ext.rb
34
34
  - spec/unicode_numeric_value_spec.rb
35
+ - table.rb
35
36
  - unicode-numeric_value.gemspec
36
37
  homepage: https://github.com/janlelis/unicode-numeric_value
37
38
  licenses: