Verify translated lyrics against musical constraints including syllable counts, rhyme scheme, and syllable patterns. Use after translating lyrics to check quality.
Verify that translated lyrics meet all musical constraints at once.
python skills/lyrics-validator/scripts/validate.py "<language>" '<target_syllables_json>' "<line1>" "<line2>" ...
Example:
python skills/lyrics-validator/scripts/validate.py cmn '[5,7,5]' "随风而去吧" "在那遥远的天边飞" "随它去吧"
Output is JSON with:
syllables: actual syllable counts per linesyllables_match: whether all match targetsrhyme_endings: detected rhyme endingsrhymes_valid: whether rhyme scheme is satisfiedfeedback: human-readable constraint feedbackfrom validate import verify_all_constraints
result = verify_all_constraints(
lines=["line1", "line2"],
language="cmn",
target_syllables=[5, 7],
rhyme_scheme="AA",
target_patterns=[[2, 3], [3, 4]],
)