blob: 9e13f7c21cea1cda140fc603fb2c76b75d8a033b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# -*- python -*-
def list_dictionaries():
return sorted(dicts.keys())
def load_dictionary(d):
global get
if d in dicts:
get = dicts[d]
return True
return False
def get_list(d):
with open(d, 'rb') as file:
return [wordmod(w) for w in file.read().decode('utf-8', 'strict').split('\n') if w != '']
dicts = {
'dict' : (lambda : ('dict.pdf', get_list('dict'), lambda p : p + 2))
}
|