Repository navigation
feat: 数詞と助数詞の音便と和語読みを補正する - #33
Merged
Merged
Conversation
辞書は数詞と助数詞の単独の読みを持つため、三本や一回、三日を 読み上げへ渡すと組み合わせの音便・和語読みが失われていた。 最良パスの隣接する語の品詞と標準読みを照合して、読みと発音を補正する。 数詞列全体の確認と別読みの保護により、十二人や十三日を誤って和語化しない。 表層形・位置・品詞・原形・コストなどは維持し、辞書キャッシュを変更しない。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
数詞と助数詞をそのまま連結した読みでは、三本がサンホン、一回がイチカイ、二人がニニンになっていました。最良パスを決めた後に、隣接する数詞・助数詞の標準読みを確認して音便と和語読みを補正します。
本・杯・匹、回・個、分、百・千、時・時間、人・日、および「十分前・十分後」が対象です。複数字の漢数字は語全体の標準読みも確認し、別読みのある辞書語を保護します。小数点以下と空白を挟む語は補正せず、表層・位置・品詞・原形・コスト・既知未知は維持します。一日のツイタチと二十日のハツカは文脈・トークン分配の制約から今回の対象外です。
設計レビューの指摘を採用し、数詞列全体の和語判定、辞書の別読みの保護、助数詞の濁音・半濁音・清音への復元を実装しました。単独の百の発音を独立して正規化する案は、三/百の連続補正で作ったビャクを保つため採用していません。最終差分レビューでは指摘なしでした。
検証:
Closes #30