From 305f5a8acb873999f4098cade648097454e46b58 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Apr 2011 11:16:34 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/metadata/sources/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/ebooks/metadata/sources/base.py b/src/calibre/ebooks/metadata/sources/base.py index f98209e580..9e574614e9 100644 --- a/src/calibre/ebooks/metadata/sources/base.py +++ b/src/calibre/ebooks/metadata/sources/base.py @@ -296,10 +296,15 @@ class Source(Plugin): if title: title_patterns = [(re.compile(pat, re.IGNORECASE), repl) for pat, repl in [ + # Remove things like: (2010) (Omnibus) etc. (r'(?i)[({\[](\d{4}|omnibus|anthology|hardcover|paperback|mass\s*market|edition|ed\.)[\])}]', ''), + # Remove commas used a separators in numbers (r'(\d+),(\d+)', r'\1\2'), + # Remove hyphens only if they have whitespace before them (r'(\s-)', ' '), + # Remove single quotes (r"'", ''), + # Replace other special chars with a space (r'''[:,;+!@#$%^&*(){}.`~"\s\[\]/]''', ' ') ]] for pat, repl in title_patterns: