Skip to content

Commit

Permalink
Merge pull request #218 from mgalgs/main
Browse files Browse the repository at this point in the history
Handle a single apostrophe more gracefully
  • Loading branch information
jaraco authored Sep 7, 2024
2 parents d7dce0c + 243e425 commit afb84cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ def get_si_pron(thecase, word, gender) -> str:
PLVERB_SPECIAL_S_RE = re.compile(rf"^({plverb_special_s})$")
WHITESPACE = re.compile(r"\s")
ENDS_WITH_S = re.compile(r"^(.*[^s])s$", re.IGNORECASE)
ENDS_WITH_APOSTROPHE_S = re.compile(r"^(.*)'s?$")
ENDS_WITH_APOSTROPHE_S = re.compile(r"^(.+)'s?$")
INDEFINITE_ARTICLE_TEST = re.compile(r"\A(\s*)(?:an?\s+)?(.+?)(\s*)\Z", re.IGNORECASE)
SPECIAL_AN = re.compile(r"^[aefhilmnorsx]$", re.IGNORECASE)
SPECIAL_A = re.compile(r"^[bcdgjkpqtuvwyz]$", re.IGNORECASE)
Expand Down
1 change: 1 addition & 0 deletions newsfragments/218.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Handle a single apostrophe more gracefully.
1 change: 1 addition & 0 deletions tests/test_pwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ def test__pl_general_verb(self):
("tuna's", "tuna's"),
("TUNA's", "TUNA's"),
("bad", False),
("'", False),
pytest.param(
"JOHN's",
"JOHNS'",
Expand Down

0 comments on commit afb84cf

Please sign in to comment.