From faab3be40e51d77c8f1ca930f9e12c0602b903bb Mon Sep 17 00:00:00 2001 From: Robin Whittleton Date: Mon, 4 Nov 2024 19:35:23 +0100 Subject: [PATCH] =?UTF-8?q?Modernize=20na=C3=AFf=20->=20naive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also add a warning that naïf as a noun is the correct usage. --- se/spelling.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/se/spelling.py b/se/spelling.py index 6857a91e..2a4c864e 100644 --- a/se/spelling.py +++ b/se/spelling.py @@ -119,6 +119,9 @@ def detect_problem_spellings(xhtml: str) -> list: if regex.search(r"\bfree[\-\s]?will", xhtml): output.append("“freewill” or “free will” or “free-will” detected. Confirm that “free will” and “free-will” are strictly nouns, and that “freewill” is strictly an adjective.") + if regex.search(r"\bna[iï]f", xhtml): + output.append("“naif” or “naïf” detected. Confirm that “naïf” is strictly a noun, and “naive” is strictly an adjective.") + return output def modernize_spelling(xhtml: str) -> str: @@ -170,6 +173,7 @@ def modernize_spelling(xhtml: str) -> str: xhtml = regex.sub(r"([Hh])ypothenuse", r"\1ypotenuse", xhtml) # hypothenuse -> hypotenuse xhtml = regex.sub(r"[‘’]([Bb])us\b", r"\1us", xhtml) # ’bus -> bus xhtml = regex.sub(r"([Nn])aïve", r"\1aive", xhtml) # naïve -> naive + xhtml = regex.sub(r"([Nn])aif", r"\1aïf", xhtml) # naif -> naïf xhtml = regex.sub(r"([Nn])a[ïi]vet[ée]", r"\1aivete", xhtml) # naïveté -> naivete xhtml = regex.sub(r"&c\.", r"etc.", xhtml) # &c. -> etc. xhtml = regex.sub(r"([Pp])rot[ée]g[ée]", r"\1rotégé", xhtml) # protege -> protégé