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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8db8bb4dbc75e3fbed4fe0327009b92883fa21a71772c6b13f045b1249090e5d
|
4
|
+
data.tar.gz: 8e43bdb9b8b4576e4dbbf6da9d2e5f7a21b72ddb310f6fbe73922531e0ee2d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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:
|
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:
|
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:
|
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
@@ -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
|
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
|
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-
|
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
|