Repository navigation
fix: 空白を挟む月名の読みを補正する - #37
Merged
Merged
Conversation
数詞と月の間に空白があると辞書の複合語に一致せず、月が普通名詞のツキとして出力されていた。 入力全体で数の境界を確認し、半角空白・タブを挟む1〜12月を暦月の読みへ補正する。 四・七・九はシ・シチ・ク、十の発音はジューとし、半角数字・全角数字・漢数字を扱う。 数詞が一語なら読みと発音以外を保持する。複数の数詞は既存の数量処理と同じ形式で数の範囲だけを合成し、 月の品詞・原形と元入力のバイト範囲を保つ。前分割前に候補を確定して小数・識別子の部分一致を避け、 期間・曜日・不正な数の表記や既知の別読みは変更しない。 構築辞書と配布3辞書の回帰テストを追加し、全feature構成の検査と26,392行の全トークン比較を実施した。
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.
概要
9 月の利用実績の数詞と月をク / ガツと読むよう、解析ライブラリで補正する。半角数字・全角数字・漢数字の1〜12月を対象とし、既存の辞書をそのまま利用できる。原因
空白があると辞書の月名の複合語に一致せず、数詞と普通名詞の「月」に分かれる。従来の数詞補正は隣接する助数詞だけを扱い、空白を挟む暦月を判定していなかった。
変更内容
設計判断
Codex の設計レビューを受け、ASCII の独立整数判定を既存の計画に集約し、候補全体を検証してから変更する方針を採用した。実辞書で
10 月が1 / 0 / 月になるため、全トークンを維持する案は採らず、数詞だけを既存の数量と同じ方式でまとめる。数詞と普通名詞に解析された同表記の人名など、意味の曖昧性の解消は対象外。差分レビューで重大な指摘はなかった。検証
ciと同等の format・workspace clippy/test、および feature なし・analyzer・download の各 lib clippy/test: passcargo test --locked --test month_readings -- --ignored: 配布3辞書で1〜12月・3表記の108例が passCloses #36