# -*- 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