Skip to content

Commit

Permalink
lint: Improve t-075
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed May 10, 2024
1 parent 05657ef commit a94d8e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ def _lint_xhtml_typography_checks(filename: Path, dom: se.easy_xml.EasyXmlTree,

if nodes:
# These words are English but have acute accents. Don't include the accent in this list because below we compare against the unaccented version.
ignored_words = ["cafe", "cafes", "regime", "regimes", "reveille", "reveilles"]
ignored_words = ["cafe", "cafes", "menage", "regime", "regimes", "reveille", "reveilles"]

# Initialize our dictionary
se.spelling.initialize_dictionary()
Expand All @@ -2767,9 +2767,9 @@ def _lint_xhtml_typography_checks(filename: Path, dom: se.easy_xml.EasyXmlTree,

# Extract each accented word, then compare against our dictionary.
# If the word IS in the dictionary, add it to the error list.
# Words that are NOT in the dictinoary are more likely to be proper names
# Words that are NOT in the dictionary are more likely to be proper names
# Note that this doesn't match word with two accent marks, like résumé. Such words are highly unlikely
# to altered for scansion anyway.
# to have accents for scansion anyway.
for word in regex.findall(r"[A-Za-z]+[áéíóú]+[A-za-z]+", node.inner_text()):
unaccented_word = unidecode(word)
if unaccented_word in se.spelling.DICTIONARY and unaccented_word not in ignored_words:
Expand Down

0 comments on commit a94d8e6

Please sign in to comment.