amakanize 0.1.5 → 0.1.6

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: 64b96abe99798d7ccb7de06558d5ef986757c622
4
- data.tar.gz: 97d48403adc0544866b0c4d404e8566a8a145421
3
+ metadata.gz: 5bb38d8892e393e75eb81d715bf0b9bb9a147a96
4
+ data.tar.gz: b32db982eb0c2cd861aacf623751ee3a8055da28
5
5
  SHA512:
6
- metadata.gz: 286377a17de01855aed5be495ac111487ed80e3ad0b630f0815b49d28d03d37fa0b3d47bf9d0ccd3ade029325a4c84d2ec2f9159e22dfa610c0eeb48fe3fba14
7
- data.tar.gz: f3fe64d424b39b75266b026da1f6370c05f3aceb34f7b09b4a1c618c11f57e2e1f21e6e468122618a26624c49e6804c4bf6615ebc975608ef64cd84d50bc2279
6
+ metadata.gz: 8e0cb8b1d13dabb362702a1af44126439d7cf705dc2d2362577da106f9794af6b4fbdcff9ee4d7c34d506190515bd81f5a9517717b57449cbb695f3733ece04c
7
+ data.tar.gz: 3da621646145ea6786b2dfa86cb27113b5f7def9522f6d773766b8cbec49ea2caada67aad594518360f3446df767ae8b1acecd99f31003fc9d06d94d2bd7d1cc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.6
2
+ - Remove trailing dash and payload on series name
3
+
1
4
  ## 0.1.5
2
5
  - Remove spaces between exclamations for 「ばくおん! !」
3
6
 
data/README.md CHANGED
@@ -11,13 +11,13 @@ Amakanize::AuthorName.new("ぽんかん(8)").to_s #=> "ぽんかん8"
11
11
  Amakanize::AuthorName.new("ぽんかん8").to_s #=> "ぽんかん8"
12
12
  Amakanize::AuthorName.new("ぽんかん⑧").to_s #=> "ぽんかん8"
13
13
 
14
- Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
15
- Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
16
- Amakanize::AuthorNames.new("ぽんかん⑧、渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
14
+ Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"]
15
+ Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"]
16
+ Amakanize::AuthorNames.new("ぽんかん⑧、渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"]
17
17
 
18
- Amaakanize::SeriesName.new("やはり俺の青春ラブコメはまちがっている。4").to_s #=> "やはり俺の青春ラブコメはまちがっている。"
19
- Amaakanize::SeriesName.new("ラブライブ! School idol diary ~星空凛~".to_s #=> "ラブライブ! School idol diary"
20
- Amaakanize::SeriesName.new("僕だけがいない街 (1) (カドカワコミックス・エース)").to_s #=> "僕だけがいない街"
18
+ Amakanize::SeriesName.new("やはり俺の青春ラブコメはまちがっている。4").to_s #=> "やはり俺の青春ラブコメはまちがっている。"
19
+ Amakanize::SeriesName.new("ラブライブ! School idol diary ~星空凛~").to_s #=> "ラブライブ! School idol diary"
20
+ Amakanize::SeriesName.new("僕だけがいない街 (1) (カドカワコミックス・エース)").to_s #=> "僕だけがいない街"
21
21
  ```
22
22
 
23
23
  ## Installation
@@ -0,0 +1,31 @@
1
+ module Amakanize
2
+ module Filters
3
+ class TrailingDashDeletionFilter < BaseFilter
4
+ TOKENS = %w(
5
+ ̃
6
+ ̰
7
+ ̴
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ ˜
16
+ ˷
17
+ ~
18
+
19
+
20
+
21
+ )
22
+
23
+ # @note Override
24
+ # @param string [String] e.g. `"アド・アストラ 1 ─スキピオとハンニバル─"`
25
+ # @return [String] e.g. `"アド・アストラ 1"`
26
+ def call(string)
27
+ string.gsub(/\s*#{::Regexp.union(TOKENS)}.*/, "")
28
+ end
29
+ end
30
+ end
31
+ end
@@ -8,6 +8,7 @@ module Amakanize
8
8
  ::Amakanize::Filters::NormalizationFilter.new,
9
9
  ::Amakanize::Filters::SpacesBetweenExclamationsDeletionFilter.new,
10
10
  ::Amakanize::Filters::TrailingParenthesesDeletionFilter.new,
11
+ ::Amakanize::Filters::TrailingDashDeletionFilter.new,
11
12
  ::Amakanize::Filters::TrailingVolumeNumberDeletionFilter.new,
12
13
  ::Amakanize::Filters::TrailingSeriesNamePayloadDeletionFilter.new,
13
14
  ]
@@ -1,3 +1,3 @@
1
1
  module Amakanize
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/amakanize.rb CHANGED
@@ -9,6 +9,7 @@ require "amakanize/filters/space_deletion_filter"
9
9
  require "amakanize/filters/spaces_between_exclamations_deletion_filter"
10
10
  require "amakanize/filters/strip_filter"
11
11
  require "amakanize/filters/trailing_author_name_payload_deletion_filter"
12
+ require "amakanize/filters/trailing_dash_deletion_filter"
12
13
  require "amakanize/filters/trailing_parentheses_deletion_filter"
13
14
  require "amakanize/filters/trailing_series_name_payload_deletion_filter"
14
15
  require "amakanize/filters/trailing_volume_number_deletion_filter"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amakanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - r7kamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -96,6 +96,7 @@ files:
96
96
  - lib/amakanize/filters/spaces_between_exclamations_deletion_filter.rb
97
97
  - lib/amakanize/filters/strip_filter.rb
98
98
  - lib/amakanize/filters/trailing_author_name_payload_deletion_filter.rb
99
+ - lib/amakanize/filters/trailing_dash_deletion_filter.rb
99
100
  - lib/amakanize/filters/trailing_parentheses_deletion_filter.rb
100
101
  - lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
101
102
  - lib/amakanize/filters/trailing_volume_number_deletion_filter.rb