japanese_address_parser 1.0.2 → 1.1.0

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
  SHA256:
3
- metadata.gz: fa2e434ee02cb867447fa1da7b0e88085b2509c22caf098eabe9ab2bd7828f3c
4
- data.tar.gz: 5210b86504698b6677252a4031020334b00df5e69e0f43b42ff5d83a4883352e
3
+ metadata.gz: 8db8bb4dbc75e3fbed4fe0327009b92883fa21a71772c6b13f045b1249090e5d
4
+ data.tar.gz: 8e43bdb9b8b4576e4dbbf6da9d2e5f7a21b72ddb310f6fbe73922531e0ee2d11
5
5
  SHA512:
6
- metadata.gz: cff9a3a7479fa60d2e23b8f085e23bc3f70d33b0dadea985075ea7bea3394f081520fa0aa6338933a30f7cc8544310776fd9cf8d7ac97aae19906da9d53f9a86
7
- data.tar.gz: 5b38e6fbf1507801bf4b86ba42caf5a759fee1270490d38e570703e2b49b45c70f06e2986122d1cd3d6780bdf893427f647b39d203f8dc9cab81b0b63ea2fe5d
6
+ metadata.gz: fcd3d146caacdab78b5d4df324cb4a5e18e57b3019a269fdc398f03241dc72c2f2f9f987bce1705d083fbed1b3eae73c39242490741209f77c642f990bd9939b
7
+ data.tar.gz: 9995a8994dc706c7af60782a9e6152fdc6ea042e35e3231972371ae6ce2341a6377738172bbb8e23a24137c8518f0ff2b19cd757f8312203771a09d5ff97278c
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-01-04 07:42:26 UTC using RuboCop version 1.24.1.
3
+ # on 2022-01-07 05:43:31 UTC using RuboCop version 1.24.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
@@ -16,17 +16,12 @@ Layout/RedundantLineBreak:
16
16
  # Offense count: 3
17
17
  # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
18
18
  Metrics/AbcSize:
19
- Max: 38
20
-
21
- # Offense count: 1
22
- # Configuration parameters: IgnoredMethods.
23
- Metrics/CyclomaticComplexity:
24
- Max: 8
19
+ Max: 39
25
20
 
26
21
  # Offense count: 4
27
22
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
28
23
  Metrics/MethodLength:
29
- Max: 35
24
+ Max: 36
30
25
 
31
26
  # Offense count: 2
32
27
  # Configuration parameters: CountComments, CountAsOne.
@@ -78,7 +73,7 @@ Style/DocumentationMethod:
78
73
  - 'lib/japanese_address_parser/models/prefecture.rb'
79
74
  - 'lib/japanese_address_parser/models/town.rb'
80
75
 
81
- # Offense count: 9
76
+ # Offense count: 8
82
77
  # Cop supports --auto-correct.
83
78
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
84
79
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -17,6 +17,12 @@ Change Log の形式は [Keep a Changelog](http://keepachangelog.com/) に従い
17
17
 
18
18
  ### Security
19
19
 
20
+ ## [1.1.0] - 2022-01-07
21
+
22
+ ### Changed
23
+
24
+ - [#23](https://github.com/yamat47/japanese_address_parser/pull/23) 町名を探索するときに前方一致を用いるのをやめた。([@yamat47](https://github.com/yamat47))
25
+
20
26
  ## [1.0.2] - 2022-01-06
21
27
 
22
28
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- japanese_address_parser (1.0.2)
4
+ japanese_address_parser (1.1.0)
5
5
  number_to_kanji
6
6
 
7
7
  GEM
@@ -65,6 +65,7 @@ GEM
65
65
 
66
66
  PLATFORMS
67
67
  arm64-darwin-21
68
+ x86_64-darwin-21
68
69
  x86_64-linux
69
70
 
70
71
  DEPENDENCIES
@@ -6,7 +6,8 @@ module JapaneseAddressParser
6
6
  # geolonia/normalize-japanese-addressesの実装を参考にしている。
7
7
  # https://github.com/geolonia/normalize-japanese-addresses/blob/6ca49c3b21cd40d2cb3118b6f38006bcf93ee10f/src/lib/dict.ts#L25
8
8
  def call(address)
9
- address_regexp = address.gsub(/三栄町|四谷三栄町/, '(三栄町|四谷三栄町)')
9
+ address_regexp = address.gsub(/大字南長野字幅下/, '(大字南長野|大字南長野字幅下)')
10
+ .gsub(/三栄町|四谷三栄町/, '(三栄町|四谷三栄町)')
10
11
  .gsub(/鬮野川|くじ野川|くじの川/, '(鬮野川|くじ野川|くじの川)')
11
12
  .gsub(/通り|とおり/, '(通り|とおり)')
12
13
  .gsub(/埠頭|ふ頭/, '(埠頭|ふ頭)')
@@ -25,7 +25,6 @@ module JapaneseAddressParser
25
25
  # 多くの場合は正規表現によって一致する町を見つけられる。
26
26
  # しかし慣例に従った表記にしている場合は見つからない可能性があるので、前方一致も試してみる。
27
27
  town = city.towns.find { |candidate| town_and_after_pattern.match?(candidate.name) }
28
- town ||= city.towns.find { |candidate| normalized_town_and_after.start_with?(candidate.name) }
29
28
 
30
29
  _build_address(full_address: full_address, prefecture: prefecture, city: city, town: town)
31
30
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JapaneseAddressParser
4
- VERSION = '1.0.2'
4
+ VERSION = '1.1.0'
5
5
  public_constant :VERSION
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: japanese_address_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamaguchi Takuya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: number_to_kanji