Add per-line meter detection

CMU stress markers -> stress string per line, scored against the
classical feet (iamb, trochee, anapest, dactyl, amphibrach) with
flexible monosyllables. Syllable count + best-fit meter shown in the
toolbar readout for the caret line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 01:12:34 -04:00
parent 84bae60dff
commit 7a1e0e2953
3 changed files with 90 additions and 3 deletions
+6 -2
View File
@@ -414,9 +414,13 @@ function buildReadout(){
schemeReadout.innerHTML = '<span class="offline">backend offline — run: uv run uvicorn app:app</span>';
return;
}
const parts = [];
const ln = caretLine();
const m = analysis && analysis.meter ? analysis.meter.find(x=>x.l===ln) : null;
if(m) parts.push(`${m.syl} syl` + (m.label ? ` · ${m.label}` : ''));
const st = caretStanza();
if(!st || !st.scheme){ schemeReadout.innerHTML = ''; return; }
schemeReadout.innerHTML = `stanza scheme &nbsp;<b>${st.scheme.toUpperCase().split('').join(' ')}</b>`;
if(st && st.scheme) parts.push(`scheme <b>${st.scheme.toUpperCase().split('').join(' ')}</b>`);
schemeReadout.innerHTML = parts.join(' &nbsp;&nbsp; ');
}
function buildLegend(){