Skip to content

Commit

Permalink
Merge pull request #171 from YuukiToriyama/feature/kashima-city/fix
Browse files Browse the repository at this point in the history
鹿嶋市の表記ゆれ: 「鹿島市」と入力された場合「鹿嶋市」に補正する
  • Loading branch information
YuukiToriyama authored Feb 10, 2024
2 parents ce20673 + fc4ad95 commit c850149
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parser/adapter/orthographical_variant_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub trait OrthographicalVariants {
const: Variant;
const: Variant;
const: Variant;
const: Variant;
}

impl OrthographicalVariants for Variant {
Expand All @@ -23,6 +24,7 @@ impl OrthographicalVariants for Variant {
const: Variant = &["崎", "﨑"];
const: Variant = &["桧", "檜"];
const: Variant = &["龍", "竜"];
const: Variant = &["嶋", "島"];
}

pub struct OrthographicalVariantAdapter {
Expand Down
1 change: 1 addition & 0 deletions src/parser/read_city.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn read_city(input: &str, prefecture: Prefecture) -> Option<(String, String)
match prefecture.name.as_str() {
"茨城県" => {
variant_list.push(Variant::);
variant_list.push(Variant::);
}
"東京都" => {
variant_list.push(Variant::);
Expand Down
5 changes: 5 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ async fn 県庁所在地のデータテスト() {
run_data_driven_tests("./tests/test_data/県庁所在地の住所データ.csv").await
}

#[tokio::test]
async fn 市区町村名レベルでの表記ゆれ() {
run_data_driven_tests("./tests/test_data/市区町村名レベルでの表記ゆれ.csv").await
}

#[tokio::test]
async fn 異字体旧字体への対応テスト() {
run_data_driven_tests("./tests/test_data/異字体旧字体への対応.csv").await
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
address,prefecture,city,town,rest
# 茨城県
茨城県鹿嶋市大字平井1187-1,茨城県,鹿嶋市,大字平井,1187-1
茨城県鹿島市大字平井1187-1,茨城県,鹿嶋市,大字平井,1187-1

0 comments on commit c850149

Please sign in to comment.