From 0e03d360a78e0f65bce816d1409d2dd61433b21d Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Thu, 28 Nov 2024 00:19:10 +0100 Subject: [PATCH] don't mark a multidigit number as an abbr --- langfilter/Spans.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langfilter/Spans.hs b/langfilter/Spans.hs index 618ed0f..2ccade9 100644 --- a/langfilter/Spans.hs +++ b/langfilter/Spans.hs @@ -91,6 +91,6 @@ abbrs (Str txt) = go $ endash txt where = abbr' l : go r | (l, r) <- Text.break isAbbr txt = Str l : go r - abbr' txt = if Text.length txt == 1 then Str txt else abbr txt + abbr' txt = if Text.any (not . isDigit) txt then abbr txt else Str txt isAbbr c = isUpper c || isDigit c || c `elem` (",.;\\[]" :: String) abbrs i = [i]