Files
swlandCursor b1afe68f3c
selftest / selftest (push) Canceled after 0s
Fix opening filler via lean tags and intro QC gate.
Stop naming filler syllables in tags (they conditioned the model); default prefer_lean_tags; hard-fail intro_filler in QC; add plugins/ hook bus as thin microkernel extension point.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 12:49:25 +08:00

18 lines
570 B
Python

# -*- coding: utf-8 -*-
"""开曲衬词守卫:在 tags 组装后做一次音节点名扫描(双保险)。"""
from ..hooks import bus
from ...core.errors import RuleViolation
_BAD = ("mm mm", "ooh ooh", "oh oh syllables", "wu wu wu",
"en en", "ng ng", "woo woo")
@bus.on("after_assemble")
def _guard_syllable_names(tags, lyrics, **_kw):
low = (tags or "").lower()
hits = [b for b in _BAD if b in low]
if hits:
raise RuleViolation(
"tags 点名衬词音节 %s(会诱发开曲衬词)" % ", ".join(hits))
return None