jisx0208 0.3.0 → 0.4.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
  SHA256:
3
- metadata.gz: df31e4cd2133bcd6d29df8dc276a6d91416830a584562e481ec7bf467317a3da
4
- data.tar.gz: 403efbc30320410819b124682aa52cf74af5c39c5e8c9558514d9666b5ef0160
3
+ metadata.gz: 81169ebbbff0fd9c19b339eda72d3b6b56a2cb7b2924e78e7692592e09b5d431
4
+ data.tar.gz: 987e03026f974ce7ed2a880ab88eee6bfd528b43d69dfa3672af29569c1d1fcd
5
5
  SHA512:
6
- metadata.gz: 34088717a5e2e284b703d50d3846e9fd0c3e4e9e94067c508a9b713eddd560bee6105c9346682174f6c8e27a6360b6a027ffbb9ca0d7e212b9b7a5d582a19cb5
7
- data.tar.gz: 567da61871adffd160b74310a96da30ea3536f61beddeea494ec1370fda8d2cd5d6aba44cb02ccb04cfd0a2d67139e4a56dc9d7036c4caa0a5aec3136f81d719
6
+ metadata.gz: f2a4199696e16c9c95e21d80d213c971c2dc726d6cd0930bd9b50c608238fccbbed3ca14b33413329e4b8b715f9314429516c4453fe4c1315cd056e767557a69
7
+ data.tar.gz: 7b7846ccab60688360110c4ae3cb4afd9ffd0aefbbc1ec93f8c8b6328a05ffc1bfafb25b446f421e4bb8cc14694110aca0ce0a9e9539cca6c56891052a0850ed
@@ -56,6 +56,12 @@ module JISX0208
56
56
  string.each_char.all? { |char| jisx0208.include?(char.ord) }
57
57
  end
58
58
 
59
+ # hiragana, katakana, multi byte symbols, first level kanji
60
+ def only_common_japanese_characters?(string)
61
+ common = @others_ranges + @first_level_ranges
62
+ string.each_char.all? { |char| common.include?(char.ord) }
63
+ end
64
+
59
65
  private
60
66
 
61
67
  def collect_unicode_set(mappings, jisx_start, jisx_end)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jisx0208
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/jisx0208.rb CHANGED
@@ -40,5 +40,9 @@ module JISX0208
40
40
  def only_jisx0208?(string)
41
41
  @processor.only_jisx0208?(string)
42
42
  end
43
+
44
+ def only_common_japanese_characters?(string)
45
+ @processor.only_common_japanese_characters?(string)
46
+ end
43
47
  end
44
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jisx0208
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaiba