Repository navigation
Make the rhyme values usable as grouping keys - #10
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Poebot2 groups verses by
consonant_rhymeandassonant_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
hrules and the accentuation fallback were all lowercase-only, soCARLOSrhymed inosagainstarlosforCarlos. The division is now taken off the lowercased word and laid back over the letters as written, soCORAZÓNstill divides as-CO-RA-ZÓN.lánguidaisaa,baileisae,reyise,averigüeisie. The unqualified value is the loose reading, where a final unstressedireads aseand a final unstresseduaso(Quilis, Métrica española), soVenusrhymes withcielo.assonant_rhyme_stricttakes the final vowel as written.consonant_rhyme_yeismoreadsllasy, soplayaandfallameet onaya. The written rhyme stays beside it.–…“”‘’. A trailing mark no longer adds a syllable or reaches the rhyme, and a verse rhymes on its last token holding letters, sola luna,la luna…andla 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, socortésmenteandcomúnmentecounted one short.PyverseErrorfor input that cannot be read, in place of whicheverIndexErrororValueErrorsurfaced first. It subclassesValueError, so existing callers keep working.Breaking
Stored
assonant_rhymekeys are invalidated. Version goes to 3.0.0.Review artifact
732 of the 1497 previously recorded verses move, all of them in
assonant_rhymealone. 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-menteadverbs, uppercase words, yeísmo pairs and verses closing on a lone punctuation token.193 tests pass, flake8 clean.
CONTEXT.mdand both halves of the README updated.🤖 Generated with Claude Code