Skip to content

Feat/pattern kana variants - #7

Merged
otnc merged 4 commits into
mainfrom
feat/pattern-kana-variants
Aug 23, 2026
Merged

Feat/pattern kana variants#7
otnc merged 4 commits into
mainfrom
feat/pattern-kana-variants

Conversation

@otnc

@otnc otnc commented Aug 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

otnc added 4 commits August 23, 2026 22:15
- 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
@otnc
otnc merged commit d4a1292 into main Aug 23, 2026
3 checks passed
@otnc
otnc deleted the feat/pattern-kana-variants branch August 23, 2026 13:38
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.

1 participant