cleaner condition, less force
This commit is contained in:
parent
beba5a3d6c
commit
cbb6e73b1f
@ -1046,10 +1046,8 @@ class WordHinter:
|
|||||||
match = re.search('[A-Za-z]{3,}', candidate)
|
match = re.search('[A-Za-z]{3,}', candidate)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
length = match.end() - match.start()
|
if 4 < match.end() - match.start() < 8:
|
||||||
if 4 > length or length > 8:
|
yield candidate[match.start():match.end()].lower()
|
||||||
continue
|
|
||||||
yield candidate[match.start():match.end()].lower()
|
|
||||||
|
|
||||||
def any_prefix(self, hint, existing):
|
def any_prefix(self, hint, existing):
|
||||||
return any(hint.startswith(e) or e.startswith(hint)
|
return any(hint.startswith(e) or e.startswith(hint)
|
||||||
|
Loading…
Reference in New Issue
Block a user