feat: anti-swear obfuscation bypass + filter statistics

- SwearNormalizer: expanded leet/lookalike map (q→р, digits), strips separators inside
  words, collapses repeated letters; single source of truth for AhoCorasick
- SwearFilter: detects obfuscated profanity on normalized text, masks tolerant matches
  in replace mode via tolerant word patterns
- FilterStatistics: per-filter block counters -> /lochat filterstats subcommand
- tests: SwearNormalizerTest, FilterStatisticsTest
This commit is contained in:
loki5512344 2026-08-09 21:17:18 +02:00
parent cda89c78e4
commit 689ab1a9ae
Signed by: boba
GPG key ID: 253067914055423B
9 changed files with 435 additions and 46 deletions

View file

@ -72,9 +72,9 @@
- Party chat: private groups `/party`.
- Network channels (Bungee/Velocity) sync.
### 2. Anti-swear hardening + filter statistics
- Bypass obfuscation: `q→р` leet/Unicode substitution, repeated chars between letters, spaces/dots inside words.
- Track filter stats (how many messages blocked per filter) → expose via command/placeholder.
### 2. Anti-swear hardening + filter statistics ✅
- Obfuscation bypass: `SwearNormalizer` (q→р / leet-подстановки, повторы букв «сууука», разделители внутри слова «с.у.к.а» / «с у к а») + tolerant-маскирование в replace-режиме. Single source of truth для Aho-Corasick.
- Filter stats: `FilterStatistics` считает блокировки по каждому фильтру → `/lochat filterstats`.
### 3. Stable plugin API + API events
- Publish `api/` modules to a repo so third-party plugins can depend on it.