|
|
|
@ -13,15 +13,16 @@ english = package_root / 'resources' / 'en.json.gz' |
|
|
|
extra_words = pathlib.Path(__file__, '..', 'extra_words.txt') |
|
|
|
|
|
|
|
|
|
|
|
def do_operation(obj, bound_method, *args, **kwargs): |
|
|
|
def do_operation(bound_method, *args, **kwargs): |
|
|
|
bound_method(*args, **kwargs) |
|
|
|
obj = bound_method.__self__ |
|
|
|
return obj |
|
|
|
|
|
|
|
|
|
|
|
default_load_future = EXECUTOR.submit( |
|
|
|
do_operation, DEFAULT, DEFAULT.load_dictionary, english) |
|
|
|
do_operation, DEFAULT.load_dictionary, english) |
|
|
|
alternate_load_future = EXECUTOR.submit( |
|
|
|
do_operation, ALTERNATE, ALTERNATE.load_text_file, english) |
|
|
|
do_operation, ALTERNATE.load_text_file, english) |
|
|
|
|
|
|
|
|
|
|
|
class Dictionary: |
|
|
|
@ -42,7 +43,8 @@ class Dictionary: |
|
|
|
def filter_func(word): return word in self.word_frequency |
|
|
|
else: |
|
|
|
def filter_func( |
|
|
|
word): return word not in excludes and word in self.word_frequency |
|
|
|
word): |
|
|
|
return word not in excludes and word in self.word_frequency |
|
|
|
return set(filter(filter_func, wordlist)) |
|
|
|
|
|
|
|
|
|
|
|
|