Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「吉冨」の表記ゆれに対応 #543

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -34,6 +34,7 @@ pub enum OrthographicalVariant {
斑,
櫻,
櫟,
冨,
}

impl OrthographicalVariant {
Expand Down Expand Up @@ -73,6 +74,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 @@ -96,6 +96,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 @@ -93,3 +93,6 @@ address,prefecture,city,town,rest
# 「南桜」と「南櫻」の表記揺れへの対応
滋賀県野洲市南桜1792,滋賀県,野洲市,南櫻,1792
滋賀県野洲市南櫻1792,滋賀県,野洲市,南櫻,1792
# 「富」と「冨」の表記ゆれへの対応
兵庫県神崎郡神河町吉冨88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号
兵庫県神崎郡神河町吉富88番地10号,兵庫県,神崎郡神河町,吉冨,88番地10号
Loading