Skip to content

Commit

Permalink
Improvements to titleFixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Feb 4, 2015
1 parent b9fed9f commit 0796b67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,12 @@ def titleFixup(text):
lambda m: m.group(1) + m.group(2).upper() + m.group(3),
text
)
text = re.sub("\b(von|van|de|du|of)\b",
lambda m: m.group(1).lower,
text
)
text = re.sub(r"'S\b", "'s", text)
text = text[0].upper() + text[1:]

return text

Expand Down

0 comments on commit 0796b67

Please sign in to comment.