From 4c99908d79ce726cffcaef7b05915f4e9e765141 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 8 Jun 2026 18:06:35 -0400 Subject: [PATCH] Phrases don't dangle on an open-vowel stopword tail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "smell like a" was matching "myself why" (EH-AY) because mosaic triples were never weak-flagged — a trailing article "a" (bare open vowel) dangles and isn't part of the rhyme. Triples now skip an open-syllable stopword tail, while closed ones ("mean to it" -> theme music) stay. Co-Authored-By: Claude Opus 4.8 (1M context) --- app.py | 5 +++++ tests/test_rhymes.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/app.py b/app.py index 864ca31..21b0494 100644 --- a/app.py +++ b/app.py @@ -617,6 +617,11 @@ def analyze(draft: Draft): continue if a["word"].lower() in refrain: continue + _pc = phones_for(c["word"]) + if (c["word"].lower() in STOPWORDS and _pc + and _pc.split()[-1][-1].isdigit()): + continue # tail is an open-vowel stopword ("smell like A") + # — it dangles; "mean to IT" (closed) still rhymes pa, pb, pc = (phones_for(a["word"]), phones_for(b["word"]), phones_for(c["word"])) if not (pa and pb and pc): diff --git a/tests/test_rhymes.py b/tests/test_rhymes.py index 4a04380..8b59772 100644 --- a/tests/test_rhymes.py +++ b/tests/test_rhymes.py @@ -767,3 +767,10 @@ def test_consonance_only_on_final_syllable(): assert not any({"meticulous", "quick"} <= s for s in bg.values()) # bliss/exist (final-syllable consonance) still works group_with("bliss whisps in the nights exist", "bliss", "exist") + + +def test_triple_not_dangling_on_stopword(): + # "smell like a" trails into an article; it shouldn't rhyme "myself why" + text = ("should I listen to myself why\n" + "it just don't smell like a") + assert "smell like a" not in highlighted(text)