Skip to content

Commit

Permalink
Make detect_problem_spellings insensitive to case
Browse files Browse the repository at this point in the history
  • Loading branch information
robinwhittleton committed Nov 6, 2024
1 parent faab3be commit e729a0a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions se/spelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,31 @@ def detect_problem_spellings(xhtml: str) -> list:
# language = get_xhtml_language(xhtml)
output = []

if regex.search(r"\bstaid\b", xhtml):
if regex.search(r"\bstaid\b", xhtml, flags=regex.I):
output.append("“staid” detected. This should be modernized if it is the past tense of “stay,” but not if used as an adjective meaning “sedate or prim.”")

if regex.search(r"\bcozen\b", xhtml):
if regex.search(r"\bcozen\b", xhtml, flags=regex.I):
output.append("“cozen” detected. This should be modernized if it means “cousin,” but not if used to mean “to deceive or win over.”")

if regex.search(r"\bgrown-?up\b", xhtml):
if regex.search(r"\bgrown-?up\b", xhtml, flags=regex.I):
output.append("“grownup” or “grown-up” detected. Confirm that “grownup” is strictly a noun, and “grown-up” is strictly an adjective.")

if regex.search(r"\bcommon[\-\s]?sense\b", xhtml):
if regex.search(r"\bcommon[\-\s]?sense\b", xhtml, flags=regex.I):
output.append("“commonsense” or “common sense” or “common-sense” detected. Confirm that “common sense” and “common-sense” are strictly nouns, and that “commonsense” is strictly an adjective.")

if regex.search(r"\bmann?ikin\b", xhtml):
if regex.search(r"\bmann?ikin\b", xhtml, flags=regex.I):
output.append("“mannikin” or “manikin” detected. Confirm that “mannikin” is used in the sense of a small person, and “mannequin” is used in the sense of a dummy or figure.")

if regex.search(r"\bgripe", xhtml):
if regex.search(r"\bgripe", xhtml, flags=regex.I):
output.append("“gripe” or “griped” detected. Confirm that “gripe” is used in the sense of illness or complaint, not in the sense of “grip” or “gripped.”")

if regex.search(r"\bmay[\-\s]?day", xhtml):
if regex.search(r"\bmay[\-\s]?day", xhtml, flags=regex.I):
output.append("“mayday” or “may day” or “may-day” detected. Confirm that “may day” and “may-day” refer to the day, and that “mayday” is used in the sense of a distress signal.")

if regex.search(r"\bfree[\-\s]?will", xhtml):
if regex.search(r"\bfree[\-\s]?will", xhtml, flags=regex.I):
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):
if regex.search(r"\bna[iï]f", xhtml, flags=regex.I):
output.append("“naif” or “naïf” detected. Confirm that “naïf” is strictly a noun, and “naive” is strictly an adjective.")

return output
Expand Down

0 comments on commit e729a0a

Please sign in to comment.