mirror of
https://github.com/kennethreitz/rhymepad.org.git
synced 2026-06-11 17:08:33 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user