amakanize 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 482894490f096214785e9de7ff6a92b1b98196d2
4
- data.tar.gz: 1828fe5db671fe569683591bbde16720acbb361b
3
+ metadata.gz: cf645efe146273c35995c2cc15251ce3850543d9
4
+ data.tar.gz: 056a8518e8b576d16aa3bc812345b39412636844
5
5
  SHA512:
6
- metadata.gz: c7289380d331cb005d62cf66ef278abe6f9c4232ce78af04893ef3d0d6c97feaeb4666100a7854c360c2f24e9b3550bba69cb9a3611a064a2423308855385e50
7
- data.tar.gz: 22229fd7e12d9a0c56c56d6e691f08c3ba8366342d2b8ebeab5ad708dbee338a032132bdf06d91fb233d26a6525d68777672b4cdc6a452f3db85d9b6dab64158
6
+ metadata.gz: 73e71248a4f1e10284f252aa5ba276f62f88071d736724911ec187324740902dba601ffb655a41e0c966f3d05b1a490d82a85781f017d7cea1a17730ce65c850
7
+ data.tar.gz: e83361fabe42d824cfba864f46fabfd0384b575a973f9d79de163d7bce7d5c4ae7e8fd070ce7e3f9c35945fe644ae2dad309d8a889a69f148129c85b0ad5bd60
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.4
2
+ - Normalize all characters
3
+
1
4
  ## 0.0.3
2
5
  - Remove space from author name
3
6
 
@@ -3,180 +3,11 @@ require "active_support"
3
3
  module Amakanize
4
4
  module Filters
5
5
  class NormalizationFilter < BaseFilter
6
- ENCLOSED_ALPHANUMERICS_COLLECTION = %w(
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
- )
172
-
173
6
  # @note Override
7
+ # @param string [String] e.g. `"ぽんかん(8)"`, `"ぽんかん⑧"`
8
+ # @return [String] e.g. `"ぽんかん(8)"`, `"ぽんかん8"`
174
9
  def call(string)
175
- ENCLOSED_ALPHANUMERICS_COLLECTION.inject(string) do |result, enclosed_alphanumerics|
176
- result.gsub(enclosed_alphanumerics) do |matched_string|
177
- ::ActiveSupport::Multibyte::Unicode.normalize(matched_string)
178
- end
179
- end
10
+ ::ActiveSupport::Multibyte::Unicode.normalize(string)
180
11
  end
181
12
  end
182
13
  end
@@ -5,7 +5,7 @@ module Amakanize
5
5
  # @param string [String] e.g. `"渡 航"`
6
6
  # @return [String] e.g. `"渡航"`
7
7
  def call(string)
8
- string.gsub(/[[:space:]]+/, "")
8
+ string.gsub(/\s+/, "")
9
9
  end
10
10
  end
11
11
  end
@@ -5,7 +5,7 @@ module Amakanize
5
5
  # @param string [String] e.g. `"  ハノカゲ  "`
6
6
  # @return [String] e.g. `"ハノカゲ"`
7
7
  def call(string)
8
- string.gsub(/\A[[:space:]]+/, "").gsub(/[[:space:]]+\z/, "")
8
+ string.strip
9
9
  end
10
10
  end
11
11
  end
@@ -11,7 +11,7 @@ module Amakanize
11
11
  # @param string [String] e.g. `"ハノカゲ ほか"`
12
12
  # @return [String] e.g. `"ハノカゲ"`
13
13
  def call(string)
14
- string.gsub(/[[:space:]]+#{::Regexp.union(PAYLOADS)}\z/, "")
14
+ string.gsub(/\s+#{::Regexp.union(PAYLOADS)}\z/, "")
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Amakanize
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amakanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - r7kamura