Detect a paragraph whose content is dominated by a comma-separated list of Title-Case proper nouns (a names list / entity roster) with very little prose connective tissue. Such paragraphs leak into the <meta description> as reader-hostile rosters like "Sigge Sigfridsson, Anna Andersson, Eva Pettersson, Lars Larsson, โฆ" when they happen to be the first paragraph after the H1 + admin byline. Skip them in readFirstParagraph so the description falls through to a real prose paragraph.
Heuristic โ high precision over recall:
3+ comma-separated segments;
โฅ 70 % of segments are short (โค 35 chars), Title-Case (/^\p{Lu}/u), and contain no sentence terminator;
paragraph contains no question mark / exclamation mark / sentence terminator before its last 8 chars (real prose has at least one).
The threshold tolerates lists that include 1-2 prose connectives like โฆ Andersson (S), Pettersson (M), and Sigfridsson (KD) โฆ while still rejecting bare roster paragraphs. Pure function โ exported for tests.
Detect a paragraph whose content is dominated by a comma-separated list of Title-Case proper nouns (a names list / entity roster) with very little prose connective tissue. Such paragraphs leak into the
<meta description>as reader-hostile rosters like "Sigge Sigfridsson, Anna Andersson, Eva Pettersson, Lars Larsson, โฆ" when they happen to be the first paragraph after the H1 + admin byline. Skip them in readFirstParagraph so the description falls through to a real prose paragraph.Heuristic โ high precision over recall:
/^\p{Lu}/u), and contain no sentence terminator;The threshold tolerates lists that include 1-2 prose connectives like
โฆ Andersson (S), Pettersson (M), and Sigfridsson (KD) โฆwhile still rejecting bare roster paragraphs. Pure function โ exported for tests.