Feat/pattern kana variants - #7
Merged
Merged
Conversation
- rework the mora building blocks as self-contained regex fragments (character class for plain mora, alternation for voiced mora like ど/ご/ぐ) so they can be concatenated freely with stem()/bare() - along the way, fix a latent bug: DO was previously the character class [どドド], which (being a class, not an alternation) also accepted a bare half-width ト or a lone combining dakuten as valid matches on their own; it's now the alternation (?:ど|ド|ド) - extend phrase-kakke/phrase-kakkoyo/phrase-egui/phrase-do-doshita/ phrase-cho/phrase-mattaku/phrase-omoroi/phrase-sugoi and the そういう part of phrase-sonna-nori to also match katakana and half-width kana spellings, matching how the original stem patterns already worked - left phrase-joudan-desu-yan/phrase-hisshi-yan as literal strings since they contain kanji that can't be swapped for kana variants directly - add stem-kita (きた/キタ/キタ + w), matching how the existing stems work
- emoji-bang (❗) / emoji-question (❓) were missing the optional \u{FE0F}
variation selector that ‼️ /⁉️ already had, so text copied with the
selector attached (❗️) relied on incidental match behavior instead of
being handled explicitly; made consistent with the other two
- also add ❗/❓ to STEM_SUFFIX's own punctuation set for consistency
- add stem-iya (いや + suffix, relaxed-only: too common standalone to be
strict)
- generalize the "やん" phrases: instead of two literal-word patterns
(必死やん / 冗談ですやん), add one phrase-yan pattern for "(です)?やん"
+ suffix regardless of the preceding word, since that's the actual
productive construction
- phrase-sonna-nori's "ノリ" now also matches のり/ノリ via NO/RI fragments
instead of being a fixed katakana literal
- each emoji pattern's source line now has a trailing comment with the
actual emoji character, since removing the label field made the raw
\u{...} escapes hard to recognize at a glance
- rewrite every pattern's samples from minimal test fragments into
realistic Twitter-style example sentences, so they double as readable
documentation of how each pattern actually gets triggered in the wild
- yan(): です/やん were literal strings; now built from DE/SU/YA/N mora fragments so katakana/half-width spellings (デス、ヤン、デスヤン...) match too - stem-ita: い+た was a single fixed pair, but the actual expression repeats (いたたたた / あいたたた); now optional あ prefix + one-or-more た repetitions
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.
No description provided.