Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize naïf -> naive #766

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):
robinwhittleton marked this conversation as resolved.
Show resolved Hide resolved
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
Loading