Skip to content

Commit

Permalink
Merge pull request #425 from YuukiToriyama/release/v0.1.15
Browse files Browse the repository at this point in the history
release/v0.1.15をmainブランチにマージ
  • Loading branch information
YuukiToriyama authored Sep 16, 2024
2 parents a25c65b + 82372ff commit fce588d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.14"
version = "0.1.15"
edition = "2021"
description = "A Rust Library to parse japanese addresses."
repository = "https://github.com/YuukiToriyama/japanese-address-parser"
Expand Down
6 changes: 5 additions & 1 deletion core/src/parser/adapter/orthographical_variant_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ pub trait OrthographicalVariants {
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
}

impl OrthographicalVariants for Variant {
Expand All @@ -38,7 +40,7 @@ impl OrthographicalVariants for Variant {
const: Variant = &["崎", "﨑"];
const: Variant = &["桧", "檜"];
const: Variant = &["龍", "竜"];
const: Variant = &["竈", "釜"];
const: Variant = &["竈", "竃", "釜"];
const: Variant = &["嶋", "島"];
const: Variant = &["舘", "館"];
const: Variant = &["脊", "背"];
Expand All @@ -55,7 +57,9 @@ impl OrthographicalVariants for Variant {
const: Variant = &["蛍", "螢"];
const: Variant = &["與", "与"];
const: Variant = &["瀧", "滝"];
const: Variant = &["籠", "篭"];
const: Variant = &["濱", "浜"];
const: Variant = &["祗", "祇"];
}

pub struct OrthographicalVariantAdapter {
Expand Down
3 changes: 3 additions & 0 deletions core/src/tokenizer/read_town.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ fn find_town(input: &str, candidates: &Vec<String>) -> Option<(String, String)>
Variant::,
Variant::,
Variant::,
Variant::,
Variant::,
Variant::,
Variant::,
Expand All @@ -109,7 +110,9 @@ fn find_town(input: &str, candidates: &Vec<String>) -> Option<(String, String)>
Variant::,
Variant::,
Variant::,
Variant::,
Variant::,
Variant::,
],
};
if let Some(result) = adapter.apply(input, candidate) {
Expand Down
9 changes: 9 additions & 0 deletions tests/test_data/異字体旧字体への対応.csv
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ address,prefecture,city,town,rest
# 「瀧本」と「滝本」の表記ゆれへの対応
和歌山県新宮市熊野川町滝本417-1,和歌山県,新宮市,熊野川町瀧本,417-1
和歌山県新宮市熊野川町瀧本417-1,和歌山県,新宮市,熊野川町瀧本,417-1
# 「籠上」と「篭上」の表記ゆれへの対応
静岡県静岡市葵区籠上13-54,静岡県,静岡市葵区,籠上,13-54
静岡県静岡市葵区篭上13-54,静岡県,静岡市葵区,籠上,13-54
# 「濱ノ瀬」と「浜ノ瀬」の表記ゆれへの対応
和歌山県日高郡美浜町大字濱ノ瀬356番3,和歌山県,日高郡美浜町,大字濱ノ瀬,356番3
和歌山県日高郡美浜町大字浜ノ瀬356番3,和歌山県,日高郡美浜町,大字濱ノ瀬,356番3
# 「木月祗園町」と「木月祇園町」の表記ゆれへの対応
神奈川県川崎市中原区木月祗園町17-1,神奈川県,川崎市中原区,木月祗園町,17-1
神奈川県川崎市中原区木月祇園町17-1,神奈川県,川崎市中原区,木月祗園町,17-1
# 「竃」と「竈」の表記ゆれへの対応
静岡県御殿場市竈1032,静岡県,御殿場市,竈,1032
静岡県御殿場市竃1032,静岡県,御殿場市,竈,1032

0 comments on commit fce588d

Please sign in to comment.