冷笑パターン(ったく/よせやい/あたぼうよ/てやんでい/そういうノリ)を追加 - #6
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
|
ご提案ありがとうございます!内容自体はとても良いと思うのですが、ちょうどこのPRと並行して 現在の構造では、 このPRの提案を今の形に直すとこんなイメージです(参考までに): // 新しいモーラ定数を追加(あいうえお順の該当位置に)
const SE = "[せセセ]"; // さ行
const TE = "[てテテ]"; // た行
const BO = "(?:ぼ|ボ|ボ)"; // ば行の濁音。半角カナの濁点は基底文字+濁点の2文字になるため文字クラスではなく選択構造にしています
// patterns配列に追加
{
id: "phrase-yoseyai",
strict: true,
source: stem(YO, SE, YA, I),
samples: ["よせやいw"],
},
{
id: "phrase-atabouyo",
strict: true,
source: stem(A, TA, BO, U, YO),
samples: ["あたぼうよw"],
},
{
id: "phrase-teyandei",
strict: true,
source: stem(TE, YA, N, DE, I),
samples: ["てやんでいw"],
},あと2点補足です:
お手数をおかけしますが、現在の |
main側でsrc/lib/regex.tsを手書き正規表現からsrc/lib/patterns.tsの データ駆動方式にリファクタリングしたため、このPRの提案(ったく/よせやい/ あたぼうよ/てやんでい/そういうノリ)を現在の構造に合わせて書き直しました。 - ったく: phrase-mattaku として既に存在(relaxedのみ) - そういうノリ: phrase-sonna-nori として既に存在(より広くマッチする形) - よせやい/あたぼうよ/てやんでい: patterns配列に新規追加 (SE/TE/BOのモーラ定数を追加し、既存のstem()ヘルパーで組み立て) Co-authored-by: Harukoto <y.games@outlook.jp>
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.
概要
インターネット上の冷笑構文をリサーチし、
regexStrictに以下のパターンを追加しました。ったく+ w/笑よせやい+ w/笑あたぼうよ+ w/笑てやんでい+ w/笑あぁ、そういうノリ…wいずれも「冷笑戦隊」コピペや冷笑構文まとめサイトで頻出する表現で、末尾に
w/笑を伴う場合に限定してマッチさせているため、通常の会話表現との誤検知リスクは低いと判断しました。可能な範囲でひらがな・カタカナ・半角カナに対応しています。変更内容
src/lib/regex.ts:regexStrictに新しい音・定型フレーズを追加test/regex.test.ts: 追加したパターンのテストケースを追加(ひらがな/カタカナ/半角カナ/w・w表記ゆれを含む)確認済み
npm run check(prettier + eslint)npm run typechecknpm run buildnpm test(52件全てパス)