Skip to content

Commit

Permalink
Merge pull request #541 from YuukiToriyama/feature/notation-distortio…
Browse files Browse the repository at this point in the history
…n/minami-zakura

「南櫻」の表記ゆれに対応
  • Loading branch information
YuukiToriyama authored Nov 16, 2024
2 parents 8f5c0e4 + d47240e commit bb18bf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/adapter/orthographical_variant_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub enum OrthographicalVariant {
,
,
,
,
}

impl OrthographicalVariant {
Expand Down Expand Up @@ -69,6 +70,7 @@ impl OrthographicalVariant {
OrthographicalVariant::鉋 => &['鉋', '飽'],
OrthographicalVariant::鷆 => &['鷆', '鷏'],
OrthographicalVariant::斑 => &['斑', '班'],
OrthographicalVariant::櫻 => &['櫻', '桜'],
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/tokenizer/read_town.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fn find_town(input: &str, candidates: &Vec<String>) -> Option<(String, String)>
OrthographicalVariant::,
OrthographicalVariant::,
OrthographicalVariant::,
OrthographicalVariant::,
],
};
if let Some(result) = adapter.apply(input, candidate) {
Expand Down
3 changes: 3 additions & 0 deletions tests/test_data/異字体旧字体への対応.csv
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ address,prefecture,city,town,rest
# 「鷏和」と「鷆和」の表記揺れへの対応
兵庫県赤穂市鷏和422,兵庫県,赤穂市,鷏和,422
兵庫県赤穂市鷆和422,兵庫県,赤穂市,鷏和,422
# 「南桜」と「南櫻」の表記揺れへの対応
滋賀県野洲市南桜1792,滋賀県,野洲市,南櫻,1792
滋賀県野洲市南櫻1792,滋賀県,野洲市,南櫻,1792

0 comments on commit bb18bf9

Please sign in to comment.