Skip to content

Make the rhyme values usable as grouping keys - #10

Merged
neburnodrog merged 2 commits into
mainfrom
feat/rhyme-keys-for-poebot2
Oct 4, 2026
Merged

neburnodrog merged 2 commits into
mainfrom
feat/rhyme-keys-for-poebot2

Conversation

@neburnodrog

Copy link
Copy Markdown
Owner

Poebot2 groups verses by consonant_rhyme and assonant_rhyme. Pyverse split groups that Spanish metrics treat as one, and leaked case and punctuation into the keys. Closes the work tracked in .scratch/rhyme-keys-for-poebot2/.

What changes

  • Case. Every rhyme is lowercase, and a capital no longer changes how a word is read. The syllabifier, the h rules and the accentuation fallback were all lowercase-only, so CARLOS rhymed in os against arlos for Carlos. The division is now taken off the lowercased word and laid back over the letters as written, so CORAZÓN still divides as -CO-RA-ZÓN.
  • Assonant rhyme. The stressed vowel plus the last audible one, nothing in between: lánguida is aa, baile is ae, rey is e, averigüe is ie. The unqualified value is the loose reading, where a final unstressed i reads as e and a final unstressed u as o (Quilis, Métrica española), so Venus rhymes with cielo. assonant_rhyme_strict takes the final vowel as written.
  • Yeísmo. consonant_rhyme_yeismo reads ll as y, so playa and falla meet on aya. The written rhyme stays beside it.
  • Punctuation. The set learns –…“”‘’. A trailing mark no longer adds a syllable or reaches the rhyme, and a verse rhymes on its last token holding letters, so la luna, la luna… and la luna, — all answer alike.
  • -mente. Read as a paroxytone always. The check existed but sat in a branch that only fires when more than two hyphens follow the written accent, so cortésmente and comúnmente counted one short.
  • Errors. PyverseError for input that cannot be read, in place of whichever IndexError or ValueError surfaced first. It subclasses ValueError, so existing callers keep working.

Breaking

Stored assonant_rhyme keys are invalidated. Version goes to 3.0.0.

Review artifact

732 of the 1497 previously recorded verses move, all of them in assonant_rhyme alone. No count, syllables, synalepha or consonant rhyme moved. All 19 distinct transitions were checked by hand against the rule. The corpus gains a fourth source, appended last so the existing entries keep their positions, covering the new marks, the -mente adverbs, uppercase words, yeísmo pairs and verses closing on a lone punctuation token.

193 tests pass, flake8 clean. CONTEXT.md and both halves of the README updated.

🤖 Generated with Claude Code

neburnodrog and others added 2 commits October 4, 2026 11:27
Poebot2 groups verses by their rhymes. Pyverse split groups that Spanish
metrics treat as one, and leaked case and punctuation into the keys.

Lowercase every rhyme, and read the assonant rhyme as the stressed vowel
plus the last audible one: 'lánguida' is 'aa', not 'aia'. The unqualified
value is the loose reading, where a final unstressed 'i' is read as 'e'
and a final unstressed 'u' as 'o' (Quilis, Métrica española), so 'Venus'
rhymes with 'cielo'. The strict reading and a yeísmo consonant rhyme,
which reads 'll' as 'y' so that 'playa' and 'falla' meet, are published
beside the two values the verse already carried.

Teach the punctuation set '–…“”‘’', so that a trailing mark stops adding
a syllable and stops reaching the rhyme, and rhyme on the last token that
holds letters, so that 'la luna, —' answers for 'luna'. All three forms
of 'la luna' now agree.

Read every adverb in -mente as a paroxytone. The check existed but sat
inside a branch that only fires when more than two hyphens follow the
written accent, so 'cortésmente' and 'comúnmente' escaped it and counted
one syllable short.

Raise PyverseError for input that cannot be read, in place of whichever
IndexError or ValueError an internal operation happened to raise first.
It subclasses ValueError so that existing callers keep working.

732 of the 1497 recorded verses move, all of them in assonant_rhyme
alone. Every one of the 19 distinct transitions was checked against the
rule. The corpus gains a fourth source, appended last so the existing
entries keep their positions, covering the new marks, the -mente
adverbs, uppercase words, yeísmo pairs and verses closing on a lone
punctuation token.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rhyme values were lower-cased on the way out, which made the strings
lowercase without making the reading case-independent. Everything
upstream of the rhyme read lower case only: the consonant cluster table
('br', 'ch'), the 'h' rules, the accentuation fallback on a final 'n' or
's', and the new -mente check. 'CARLOS' rhymed in 'os' against 'arlos'
for 'Carlos', and 'RÁPIDAMENTE' counted 3 against 5.

Syllabify the lower-cased word and lay the division back over the
letters as the verse writes them, and read the accentuation off lower
case too. The reading is now the word's; the capitals stay the verse's,
so 'CORAZÓN' still divides as '-CO-RA-ZÓN'.

Also say what the digit check actually rejects. It fires for a token
that is neither a word nor a number, such as the '3º' of 'el 3º', which
holds no letters to mix with its digit.

No recorded Verse moves. The corpus gains the words whose reading a
capital used to change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@neburnodrog
neburnodrog merged commit 0dd2e3a into main Oct 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant