aboutsummaryrefslogtreecommitdiffstats
path: root/example/dlurc
diff options
context:
space:
mode:
Diffstat (limited to 'example/dlurc')
-rw-r--r--example/dlurc19
1 files changed, 19 insertions, 0 deletions
diff --git a/example/dlurc b/example/dlurc
new file mode 100644
index 0000000..9e13f7c
--- /dev/null
+++ b/example/dlurc
@@ -0,0 +1,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))
+}