1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Fixed a few bugs here and there.

This commit is contained in:
Virgil Dupras
2011-01-22 16:12:18 +01:00
parent dbcd7b63d8
commit f9e7e82772
11 changed files with 65 additions and 42 deletions

View File

@@ -24,9 +24,8 @@ NO_FIELD_ORDER) = range(3)
JOB_REFRESH_RATE = 100
def getwords(s):
if isinstance(s, str):
# XXX is this really needed?
s = normalize('NFD', s)
# We decompose the string so that ascii letters with accents can be part of the word.
s = normalize('NFD', s)
s = multi_replace(s, "-_&+():;\\[]{}.,<>/?~!@#$*", ' ').lower()
s = ''.join(c for c in s if c in string.ascii_letters + string.digits + string.whitespace)
return [_f for _f in s.split(' ') if _f] # remove empty elements