Exact rime lets stopword-anchored phrases pair with words

Prufrock's "is it" / "visit" are phone-for-phone identical; identity
evidence overrides the anchor rule. Stopword-anchored phrases still
can't form groups among themselves.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 03:03:48 -04:00
parent 58ee98d175
commit 2b9395f0ee
2 changed files with 15 additions and 3 deletions
+7 -3
View File
@@ -493,9 +493,10 @@ def analyze(draft: Draft):
for key in rime_keys(t["word"]):
by_rime[key].append(t)
for p in phrases:
# "bought it" competes; "to me" / "but I" never found anything
if p["word"].split()[0] not in STOPWORDS:
by_rime["p:" + p["rime"]].append(p)
# all phrases compete on exact rime — "is it" matches "visit"
# phone-for-phone; the qualification below stops stopword-anchored
# phrases from pairing with nothing but each other
by_rime["p:" + p["rime"]].append(p)
# biggest buckets claim their tokens first, so a word with several
# candidate pronunciations joins its best-supported rhyme group.
@@ -512,6 +513,9 @@ def analyze(draft: Draft):
end_count = sum(t["is_end"] for t in toks)
if len(distinct) < 2 and end_count < 2:
continue # the same word repeated mid-line isn't a rhyme
if all(" " in t["word"] and t["word"].split()[0] in STOPWORDS
for t in toks):
continue # stopword-anchored phrases need a real-word partner
raw_groups.append({"toks": toks, "slant": False, "key": key})
claimed.update(id(t) for t in toks)
+8
View File
@@ -383,3 +383,11 @@ def test_mosaic_finds_perfect_members_other_anchor():
text = ("Gambino is a mastermind, fuck a bitch to pass the time\n"
"Mass appeal, orange rind, smoke your green, I'm spendin' mine")
group_with(text, "mastermind", "rind", "pass the time")
def test_eliot_is_it_visit():
# Prufrock's signature mosaic: phone-for-phone identical rimes
text = ('Oh, do not ask, "What is it?"\n'
"Let us go and make our visit.")
group_with(text, "is it", "visit")
assert scheme(text) == "aa"