Skip to content

Commit

Permalink
Merge pull request #290 from YuukiToriyama/release/v0.1.2
Browse files Browse the repository at this point in the history
release/v0.1.2をmainブランチにマージ
  • Loading branch information
YuukiToriyama authored Jun 8, 2024
2 parents 3cd2a68 + 3b19e1c commit 1a53e19
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 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.1"
version = "0.1.2"
edition = "2021"
description = "A Rust Library to parse japanese addresses."
repository = "https://github.com/YuukiToriyama/japanese-address-parser"
Expand Down
10 changes: 10 additions & 0 deletions core/src/parser/adapter/orthographical_variant_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ pub trait OrthographicalVariants {
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
const: Variant;
}

impl OrthographicalVariants for Variant {
Expand All @@ -33,6 +38,11 @@ impl OrthographicalVariants for Variant {
const: Variant = &["舘", "館"];
const: Variant = &["脊", "背"];
const: Variant = &["渕", "淵"];
const: Variant = &["己", "巳"];
const: Variant = &["槇", "槙"];
const: Variant = &["治", "冶"];
const: Variant = &["佛", "仏"];
const: Variant = &["澤", "沢"];
}

pub struct OrthographicalVariantAdapter {
Expand Down
5 changes: 5 additions & 0 deletions core/src/parser/read_town.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ fn find_town(input: &String, city: &City) -> Option<(String, String)> {
Variant::舘,
Variant::脊,
Variant::渕,
Variant::己,
Variant::槇,
Variant::治,
Variant::佛,
Variant::澤,
],
};
if let Some(result) = adapter.apply(input, &town.name) {
Expand Down
19 changes: 17 additions & 2 deletions tests/test_data/異字体旧字体への対応.csv
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ address,prefecture,city,town,rest
# 「花背」と「花脊」の表記ゆれへの対応
京都府京都市左京区花脊大布施町196番地,京都府,京都市左京区,花脊大布施町,196番地
京都府京都市左京区花背大布施町196番地,京都府,京都市左京区,花脊大布施町,196番地
# 「三渕沢」と「三淵沢」の表記ゆれ
# 「三渕沢」と「三淵沢」の表記ゆれへの対応
新潟県魚沼市三渕沢879,新潟県,魚沼市,三渕沢,879
新潟県魚沼市三淵沢879,新潟県,魚沼市,三渕沢,879
新潟県魚沼市三淵沢879,新潟県,魚沼市,三渕沢,879
# 「辰巳」と「辰己」の表記ゆれへの対応
京都府京都市伏見区醍醐辰己町4-1,京都府,京都市伏見区,醍醐辰己町,4-1
京都府京都市伏見区醍醐辰巳町4-1,京都府,京都市伏見区,醍醐辰己町,4-1
# 「槇島町」と「槙島町」の表記ゆれへの対応
京都府宇治市槇島町千足80,京都府,宇治市,槇島町,千足80
京都府宇治市槙島町千足80,京都府,宇治市,槇島町,千足80
# 「鍛治屋町」と「鍛冶屋町」の表記ゆれへの対応
京都府綾部市鍛治屋町岡ノ段26,京都府,綾部市,鍛治屋町,岡ノ段26
京都府綾部市鍛冶屋町岡ノ段26,京都府,綾部市,鍛治屋町,岡ノ段26
# 「佛性寺」と「仏性寺」の表記ゆれへの対応
京都府福知山市大江町佛性寺909,京都府,福知山市,大江町佛性寺,909
京都府福知山市大江町仏性寺909,京都府,福知山市,大江町佛性寺,909
# 「棚沢」と「棚澤」の表記ゆれへの対応
東京都西多摩郡奥多摩町棚澤446,東京都,西多摩郡奥多摩町,棚澤,446
東京都西多摩郡奥多摩町棚沢446,東京都,西多摩郡奥多摩町,棚澤,446

0 comments on commit 1a53e19

Please sign in to comment.