Metadata download: Fix metadata download not working for titles that contain a apostrophes in languages other than English. Fixes #1403677 [Search metadata fails](https://bugs.launchpad.net/calibre/+bug/1403677)

This commit is contained in:
Kovid Goyal 2014-12-25 08:48:05 +05:30
parent c33d682de7
commit 9106c49b49

View File

@ -377,8 +377,6 @@ class Source(Plugin):
(r'(\d+),(\d+)', r'\1\2'),
# Remove hyphens only if they have whitespace before them
(r'(\s-)', ' '),
# Remove single quotes not followed by 's'
(r"'(?!s)", ''),
# Replace other special chars with a space
(r'''[:,;!@$%^&*(){}.`~"\s\[\]/]''', ' '),
]]
@ -388,7 +386,7 @@ class Source(Plugin):
tokens = title.split()
for token in tokens:
token = token.strip()
token = token.strip().strip('"').strip("'")
if token and (not strip_joiners or token.lower() not in ('a',
'and', 'the', '&')):
yield token