A cynghanedd checker that follows the rules
A checker that judges every line consistently by the same rules, not by intuition.

The checker is part of Bangor AI's research. Follow the project in the BangorAI/cynghanedd repository on GitHub.
What it does
Give it a line and it returns a verdict: croes, traws, sain or llusg, identifying subtypes and showing matching consonants—or naming the fault: twyll gynghanedd, camosodiad, gormod o odl, trwm ac ysgafn, dyrchafedig, ailadrodd gair. Every possible break in the line is tried; it is valid if any reading succeeds. As well as individual lines, it checks complete metres: cywydd (with stressed/unstressed rhyme and its llusg rule), englyn unodl union, milwr, penfyr and proest, cyhydedd nawban, gwawdodyn, hir-a-thoddaid, awdl-gywydd, and toddaid rules.
The phonological foundation
You cannot judge without knowing how to pronounce. The engine follows a sequence: user lexicon → Bangor University pronunciation dictionary (around 29,000 words) → de-mutation (recognising ‘draig’ behind ‘ddraig’, then adjusting phonemes) → compounds → limited English dictionary → letter-to-sound rules when everything else fails. These fallback rules count syllables correctly for 95.9% of words in the full dictionary.
One unexpected principle proved crucial: poetic spelling, not the dictionary, determines syllable count. Bangor's data transcribes spoken pronunciation—‘ffenestr’ as three syllables and ‘gwlad’ as two—but strict metre counts them as two and one. Orthographic rules therefore count syllables, while the dictionary supplies phonemes and stress. Syllable count can also vary: rhyme slippage can add a syllable, and contraction can remove one.
Tested on real poetry
- A standard test suite from Clywed Cynghanedd lessons, including Sain Anghytbwys Ddisgynedig, cynghanedd lafarog, caesura boundaries and deliberately corrupted examples.
- Medieval corpus: 70 lines of Dafydd ap Gwilym's ‘Trafferth mewn Tafarn’ were used to develop the medieval profile.
- Modern corpus: 188 labelled strict-metre poems from Barddasmagazines were used. Copyright prevents republication of these texts.
- Status of the figures: previous accuracy and false-acceptance figures were withdrawn while the corpora are rescored with the corrected checker. A versioned manifest and reproducible summary results will be published.
Why is a consistent, rules-based judge needed?
Because models exploit any gap in the measures. They do not do this intentionally; they are trained to perform as well as possible against the test provided. Two examples from Bangor AI's experience:
Mutations hiding repetition: in one experiment, the model produced a ‘valid’ hir-a-thoddaid by rhyming teulu with mutated forms of the same word six times. The checker responded by adding a test recognising different mutated forms of the same word: teulu~deulu is repetition, not rhyme.
Invented words: another model learned to coin nonexistent words—‘gwinoth’, ‘hudod’, ‘llonells’. Letter-to-sound rules could pronounce them, so the checker accepted them. Not every unknown word can be banned, since it could be a valid name or borrowing. Instead, every word relying on fallback rules is recorded, such lines are excluded from training data, and an explicit penalty is applied during judging.
This lesson is now part of our evaluation methods: we must test whether models can fool the checker before using its score as a training reward. Whenever a model finds a new loophole, a new test is added to the checker. Ironically, each shortcut makes the judging system stronger.
Read next: the improvement cycle →
