Skip to content

Commit

Permalink
Sort titles
Browse files Browse the repository at this point in the history
  • Loading branch information
apasel422 authored and acabal committed Jun 2, 2024
1 parent f68eeca commit bae7c5b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions se/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,30 @@ def semanticate(xhtml: str) -> str:

# Some common abbreviations
xhtml = regex.sub(r"(?<!(?:\.|\B|\<abbr[^>]*?\>))(\L<titles>\.)", r"""<abbr epub:type="z3998:name-title">\1</abbr>""", xhtml, titles=[
"Mr",
"Mrs",
"Ms",
"Capt",
"Col",
"Dr",
"Drs",
"Prof",
"Rev",
"Esq",
"Fr",
"Hon",
"Lieut",
"Fr",
"Lt",
"Capt",
"Pvt",
"Esq",
"MM",
"Mdlle",
"Messers",
"Messrs",
"Mlle",
"Mlles",
"Mme",
"Mmes",
"Mon",
"Mlle",
"Mdlle",
"Mlles",
"Messrs",
"Messers",
"Col",
"Mr",
"Mrs",
"Ms",
"Prof",
"Pvt",
"Rev",
])
xhtml = regex.sub(r"(?<!(?:\.|\B|\<abbr[^>]*?\>))Bros\.", r"<abbr>Bros.</abbr>", xhtml)
xhtml = regex.sub(r"(?<!(?:\.|\B|\<abbr[^>]*?\>))Mt\.", r"<abbr>Mt.</abbr>", xhtml)
Expand Down

0 comments on commit bae7c5b

Please sign in to comment.