Skip to content

Commit

Permalink
Modernize naïf -> naive
Browse files Browse the repository at this point in the history
Also add a warning that naïf as a noun is the correct usage.
  • Loading branch information
robinwhittleton committed Nov 6, 2024
1 parent 570a9ac commit faab3be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions se/spelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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é
Expand Down

0 comments on commit faab3be

Please sign in to comment.