mirror of https://github.com/django/django.git
Removed Lawrence-specific stuff in utils.text.recapitalize. Refs #467
git-svn-id: http://code.djangoproject.com/svn/django/trunk@638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
99e0f7a932
commit
84560c7f84
|
@ -62,13 +62,13 @@ def normalize_newlines(text):
|
||||||
|
|
||||||
def recapitalize(text):
|
def recapitalize(text):
|
||||||
"Recapitalizes text, placing caps after end-of-sentence punctuation."
|
"Recapitalizes text, placing caps after end-of-sentence punctuation."
|
||||||
capwords = 'I Jayhawk Jayhawks Lawrence Kansas KS'.split()
|
# capwords = ()
|
||||||
text = text.lower()
|
text = text.lower()
|
||||||
capsRE = re.compile(r'(?:^|(?<=[\.\?\!] ))([a-z])')
|
capsRE = re.compile(r'(?:^|(?<=[\.\?\!] ))([a-z])')
|
||||||
text = capsRE.sub(lambda x: x.group(1).upper(), text)
|
text = capsRE.sub(lambda x: x.group(1).upper(), text)
|
||||||
for capword in capwords:
|
# for capword in capwords:
|
||||||
capwordRE = re.compile(r'\b%s\b' % capword, re.I)
|
# capwordRE = re.compile(r'\b%s\b' % capword, re.I)
|
||||||
text = capwordRE.sub(capword, text)
|
# text = capwordRE.sub(capword, text)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def phone2numeric(phone):
|
def phone2numeric(phone):
|
||||||
|
|
Loading…
Reference in New Issue