1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
NAME
dlu - Dictionary lookup utility
SYNOPSIS
dlu (-l | dictionary word)
DESCRIPTION
dlu looks up a selected word in a selected scanned dictionary.
dlu is configured via ~/.config/dlu/dlurc, a Python 3 file
which defines the functions:
list_dictionaries()
Returns a list of all dictionaries.
load_dictionary(dictionary : str) -> bool
Sets the function get() or a variable that get() reads
to identify which dictionary has been selected. The
function shall return True if the dictionary exists,
and False otherwise.
open_dictionary(file : str, page : int)
Opens the specified page in the specified file.
The default implementation opens atril(1), evince(1),
xpdf(1), or jfbview(1) to display the specified file
and page.
wordmod(word : str) -> str
Modifies and returns a word so that it can be used
to compare against known words in the dictionary.
The default implementation of this function converts
the word to lower case using Python's string class's
lower() function.
before(word1 : str, word2 : str) -> bool
Collation function that checks that word1 comes before
word2 in the dictionary (if so, it returns True,
otherwise it returns False).
The default implementation of this function compares
in C locale.
get() -> tuple
Returns a 3-tuple containing, in order: the filename
of the scanned dictionary, a list of the last word on
each page, and a int-to-int function that maps the
index of a word, in the list in the second element of
the returned tuple, to a page in the dictionary.
OPTIONS
-l Print a list of all dictionaries.
FILES
~/.config/dlu/dlurc
The configuration file.
|