From 983d9280ec83cf83a7ea025e72e4c5eb9c0fcae9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 May 2012 20:11:36 +0530 Subject: [PATCH] Automatic titlecasing: No longer try to capitalize scottish names, as there are too many special cases. Fixes #775825 (titlecase error on the word (part) macht) --- src/calibre/utils/titlecase.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/calibre/utils/titlecase.py b/src/calibre/utils/titlecase.py index 12f3079a10..97daed23a9 100755 --- a/src/calibre/utils/titlecase.py +++ b/src/calibre/utils/titlecase.py @@ -28,8 +28,6 @@ SUBPHRASE = re.compile(r'([:.;?!][ ])(%s)' % SMALL) APOS_SECOND = re.compile(r"^[dol]{1}['‘]{1}[a-z]+$", re.I) ALL_CAPS = re.compile(r'^[A-Z\s%s]+$' % PUNCT) UC_INITIALS = re.compile(r"^(?:[A-Z]{1}\.{1}|[A-Z]{1}\.{1}[A-Z]{1})+$") -MAC_MC = re.compile(r"^([Mm]a?c)(.+)") - _lang = None @@ -40,7 +38,6 @@ def lang(): _lang = get_lang().lower() return _lang - def titlecase(text): """ @@ -78,13 +75,6 @@ def titlecase(text): line.append(icu_lower(word)) continue - if lang().startswith('en'): - match = MAC_MC.match(word) - if match and not match.group(2)[:3] in ('hin', 'ht'): - line.append("%s%s" % (capitalize(match.group(1)), - capitalize(match.group(2)))) - continue - hyphenated = [] for item in word.split('-'): hyphenated.append(CAPFIRST.sub(lambda m: icu_upper(m.group(0)), item))