@@ -150,11 +150,12 @@ const SIM_NAME = /\bSim\b/
150150const CONTRAST = String . raw `(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)`
151151/**
152152 * A comparison set off by commas, as in "Sim, unlike Zapier, has ..." or "Zapier, like Sim, has
153- * ...", removed so the sentence keeps its subject. The span ends at the first comma that is not a
154- * thousands separator, and it is kept when a relative clause follows ("unlike Zapier, which has").
153+ * ...", removed so the sentence keeps its subject. The span stays inside its sentence, ends at the
154+ * first comma that is not a thousands separator, and is kept when a relative clause follows
155+ * ("unlike Zapier, which has").
155156 */
156157const PARENTHETICAL_COMPARISON = new RegExp (
157- String . raw `,\s+(?:like|${ CONTRAST } )\s+(?:[^,]|, (?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)` ,
158+ String . raw `,\s+(?:like|${ CONTRAST } )\s+(?:[^,.!?;]|[,.] (?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)` ,
158159 'gi'
159160)
160161/** A sentence end, or a contrast that hands the rest of the sentence to another subject. */
@@ -164,7 +165,7 @@ const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+`,
164165 * that states a count of its own ("While Sim has 280+ integrations, ...") is kept.
165166 */
166167const LEADING_COMPARISON = new RegExp (
167- String . raw `^(?:like|${ CONTRAST } )\b(?:[^,]|, (?=\d))*?,(?!\d)\s*` ,
168+ String . raw `^(?:like|${ CONTRAST } )\b(?:[^,.!?;]|[,.] (?=\d))*?,(?!\d)\s*` ,
168169 'i'
169170)
170171/** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */
0 commit comments