script_detector_2 0.1.0 → 0.1.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: 27b39d88507e32b9e36090c9612b98e58102694728ffe3a92d0016bfd4be05b3
4
- data.tar.gz: 3938cf9b3c1f0cafeb4a760c498c54ae8cfeabb991cce8b3bd960a3df5537f63
3
+ metadata.gz: 838e7ab01b6736b5afc135b6a062235a921862b0a580d4fe8c6e8be84fcbe15f
4
+ data.tar.gz: 2ceb59009e8eb81d2ef635221ffb98b5eaf718eea3c6dd65a3835d5487c343fd
5
5
  SHA512:
6
- metadata.gz: 390462194fb378cc0ced1b412c20b25a8c234a627db963fada315e2ab419b87da59f5c64f850278af4d0cbb2275739d47707434cdd3dab39c09a19ed8800b83b
7
- data.tar.gz: 8ea146afc460673c14f229762380440c35688d951965ea676e6b3de5caf95bd8a7d56da295afce9ea6fb807e24693e641a3bd1bac6b1db835e8504b102668792
6
+ metadata.gz: 5297b4ffcdf61ffa90af98b7243773f9ac8bc20abac8a3879892670f90d524fdbb9e38fb962b250c3f9a3fb8e184b179d9db5c629c9de101014233cc3d399c26
7
+ data.tar.gz: a1f7fee7616b01f5c1aa8e1f92d0e2dbf7256e7c00d7002236e83dad4a0d25f55c7840eaa1c6c3474a2cdf3d167937eba8ef936818e733e29342a21fb9dfd124
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,22 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-08-21 13:26:50 UTC using RuboCop version 1.19.1.
3
+ # on 2021-08-22 13:16:05 UTC using RuboCop version 1.19.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # Configuration parameters: IgnoredMethods.
11
+ Metrics/CyclomaticComplexity:
12
+ Max: 8
13
+
9
14
  # Offense count: 1
10
15
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
11
16
  Metrics/MethodLength:
12
17
  Max: 14
18
+
19
+ # Offense count: 1
20
+ # Configuration parameters: IgnoredMethods.
21
+ Metrics/PerceivedComplexity:
22
+ Max: 10
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2021-08-21
4
+
5
+ - Improve identification of ambiguous Chinese
6
+
3
7
  ## [0.1.0] - 2021-08-21
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- script_detector_2 (0.1.0)
4
+ script_detector_2 (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -64,11 +64,15 @@ module ScriptDetector2
64
64
  # @param string [String]
65
65
  # @return [Symbol]
66
66
  def identify_script(string)
67
- if japanese?(string) then :Jpan
68
- elsif korean?(string) then :Kore
69
- elsif traditional_chinese?(string) then :Hant
70
- elsif simplified_chinese?(string) then :Hans
71
- elsif chinese?(string) then :Hani
67
+ return :Jpan if japanese?(string)
68
+ return :Kore if korean?(string)
69
+
70
+ is_hant = traditional_chinese?(string)
71
+ is_hans = simplified_chinese?(string)
72
+ if is_hant && is_hans then :Hani
73
+ elsif is_hans then :Hans
74
+ elsif is_hant then :Hant
75
+ elsif chinese?(string) then :Hani # rubocop:disable Lint/DuplicateBranch
72
76
  else :Zyyy
73
77
  end
74
78
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScriptDetector2
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: script_detector_2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Madlon-Kay