FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix APOS_SECOND possessive noun · Garrett-R/python-titlecase@d84a691 · GitHub

Repository navigation

Commit d84a691

Browse files
committed
Fix APOS_SECOND possessive noun
Thanks to @pfaulks. Closes ppannuto#10.
1 parent 320d65d commit d84a691

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎titlecase/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SMALL_FIRST = re.compile(r'^([%s]*)(%s)\b' % (PUNCT, SMALL), re.I)
2323
SMALL_LAST = re.compile(r'\b(%s)[%s]?$' % (SMALL, PUNCT), re.I)
2424
SUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL)
25-
APOS_SECOND = re.compile(r"^[dol]{1}['‘]{1}[a-z]+$", re.I)
25+
APOS_SECOND = re.compile(r"^[dol]{1}['‘]{1}[a-z]+(?:['s]{2})?$", re.I)
2626
ALL_CAPS = re.compile(r'^[A-Z\s\d%s]+$' % PUNCT)
2727
UC_INITIALS = re.compile(r"^(?:[A-Z]{1}\.{1}|[A-Z]{1}\.{1}[A-Z]{1})+$")
2828
MAC_MC = re.compile(r"^([Mm]c)(\w.+)")

‎titlecase/tests.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
"o'grange O'grange o'Grange O'Grange",
173173
"O'Grange O'Grange O'Grange O'Grange",
174174
),
175+
(
176+
"o'grange's O'grange's o'Grange's O'Grange's",
177+
"O'Grange's O'Grange's O'Grange's O'Grange's",
178+
),
175179
(
176180
"O'GranGe",
177181
"O'GranGe",

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL