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

NormalizerNFKC: add unify_katakana_di_sound option #1504

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

HashidaTKS
Copy link
Contributor

@HashidaTKS HashidaTKS commented Feb 1, 2023

When unify_katakana_di_sound is specified, NormalizerNFKC* normalize characters as below.

ヂ -> ジ

normalize \
  'NormalizerNFKC130("unify_katakana_di_sound", true, \
                     "report_source_offset", true)' \
  "ヂ" \
  WITH_CHECKS|WITH_TYPES

@HashidaTKS
Copy link
Contributor Author

In the current implementation, normalizers normalize ヂャ to ジャ.
I'm not confident with that behaviour is good or not...
In the first place, ヂャ is a valid Japanese letter...?

@HashidaTKS
Copy link
Contributor Author

HashidaTKS commented Feb 1, 2023

考えてみると、「ヂ」を使うということは現代仮名遣いじゃないことを想定しているので、「ヂャ」「ヂュ」「ヂョ」を使うこともあるか。
これらは「ジャ」「ジュ」「ジョ」にしてしまってよいのだろうか。それとも「ヂャ」「ヂュ」「ヂョ」はそれぞれ別の文字とみなすべきだろうか?

普通は「ジャ」「ジュ」「ジョ」になることを期待するだろうし、単独の「ヂ」しか変更しないのは単純に使い勝手の面からも不便そうではある。
変換される仕様で良いこととしよう...。

@kou
Copy link
Member

kou commented Feb 1, 2023

Is the example in the description correct?

@kou
Copy link
Member

kou commented Feb 1, 2023

ちょっとなにを心配しているのかわからないんですが、「ヂャ」が「ジャ」になるとダメじゃない?と言っていますか?
そうだとして、その場合はなにがダメだと言っていますか?

@HashidaTKS
Copy link
Contributor Author

ちょっとなにを心配しているのかわからないんですが、「ヂャ」が「ジャ」になるとダメじゃない?と言っていますか?
そうだとして、その場合はなにがダメだと言っていますか?

前提として、 #1501 などで小書き文字を含めて別の一文字にノーマライズする対応をしていたことから、「ヂ」と「ヂャ」は別の一文字扱いになるのでは?というような意識が働いていました。
そのうえで、具体的に駄目なケースがあるわけではなく「ヂ」-> 「ジ」とするノーマライザーと「ヂャ」-> 「ジャ」とするノーマライザーは分けたほうが良いのでは?というような疑問を覚えていました。

なのですが、よくよく考えてみると #1501 は小書き文字まで含めて別の一文字に変換しているが、「ヂャ」-> 「ジャ」は「ヂ」が「ジ」に変わるだけで特に「ヂャ」で一文字という感じでもないですし、ユーザーもこのノーマライザーで「ヂャ」-> 「ジャ」になることを期待するだろうことから、単純に「ヂ」 -> 「ジ」としてしまって良いという結論に至りました。

@HashidaTKS
Copy link
Contributor Author

Is the example in the description correct?

Fixed.

@HashidaTKS HashidaTKS marked this pull request as ready for review February 2, 2023 03:17
@kou
Copy link
Member

kou commented Feb 2, 2023

Could you remove s from option name because this processes only one character?
unify_katakana_di_sound

@HashidaTKS
Copy link
Contributor Author

Could you remove s from option name because this processes only one character? unify_katakana_di_sound

Fixed.

@HashidaTKS HashidaTKS changed the title NormalizerNFKC: add unify_katakana_di_sounds option NormalizerNFKC: add unify_katakana_di_sound option Feb 2, 2023
@HashidaTKS
Copy link
Contributor Author

HashidaTKS commented Feb 2, 2023

@kou

Would you review this?
It would be nice if you could merge this with priority over #1503, #1502.
(I don't want to resolve conflicts multiple times...)

@kou kou merged commit c803275 into master Feb 2, 2023
@kou kou deleted the add-unify_katakana_di_sounds branch February 2, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants