aboutsummaryrefslogtreecommitdiff
path: root/man/man1/dict.1
blob: d382acc4763660adbf6988eaf2f55b55679e3a9c (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
.TH DICT 1
.SH NAME
dict, adict \- dictionary browser
.SH SYNOPSIS
.B dict
[
.B -k
]
[
.B -d
.I dictname
]
[
.B -c
.I command
]
[
.I pattern
]
.B adict
[
.B -d
.I dictname
]
[
.I pattern
]
.SH DESCRIPTION
.I Dict
is a dictionary browser.
If a
.I pattern
is given on the command line,
.I dict
prints all matching entries;
otherwise it repeatedly accepts and executes commands.
The options are
.TF -d\ \fIdictname\fP
.TP
.BI -d " dictname"
Use the given dictionary.
A list of available dictionaries is printed by option
.BR -d? .
The default is the first dictionary on the list that is
installed on the system.
.TP
.BI -c " command"
Execute one command and quit.
The command syntax is described below.
.TP
.B -k
Print a pronunciation key.
.PD
.PP
Patterns are regular expressions (see
.IR regexp (7)),
with an implicit leading
.L ^
and trailing
.LR $ .
Patterns are matched against an index of headwords and variants,
to form a `match set'.
By default, both patterns and the index are folded:
upper case characters are mapped into their lower case equivalents,
and Latin accented characters are mapped into their non-accented
equivalents.
In interactive mode, there is always a `current match set'
and a `current entry' within the match set.
Commands can change either or both, as well as print the entries
or information about them.
.PP
Commands have an address followed by a command letter.
Addresses have the form:
.TF /\fIre\fP/.\fIn\fP
.TP
.BI / re /
Set the match set to all entries matching the regular expression
.IR re ,
sorted in dictionary order.
Set the current entry to the first of the match set.
.TP
.BI ! re !
Like
.BI / re /
but use exact matching, i.e., without case and accent folding.
.TP
.I n
An integer
.I n
means change the current entry to the
.IR n th
of the current match set.
.TP
.BI # n
The integer
.I n
is an absolute byte offset into the raw dictionary.
(See the
.B A
command, below.)
.TP
.IB addr +
After setting the match set and current entry according to
.IR addr ,
change the match set and current entry to be the next entry
in the dictionary (not necessarily in the match set) after
the current entry.
.TP
.IB addr -
Like
.IB addr +
but go to previous dictionary entry.
.PD
.PP
The command letters come in pairs: a lower case and the
corresponding upper case letter.
The lower case version prints something about the current
entry only, and advances the current entry to the next
in the match set (wrapping around to the beginning after
the last).
The upper case version prints something about all of the
match set and resets the current entry to the beginning of
the set.
.TF \fLa,A\fP
.TP
.BR p , P
Print the whole entry.
.TP
.BR h , H
Print only the headword(s) of the entry.
.TP
.BR a , A
Print the dictionary byte offset of the entry.
.TP
.BR r , R
Print the whole entry in raw format (without translating
special characters, etc.).
.PD
.PP
If no command letter is given for the first command,
.B H
is assumed.
After an
.BR H ,
the default command is
.BR p .
Otherwise, the default command is the previous command.
.PP
.I Dict
searches for dictionaries in the directory named by
.B $dictpath 
(default
.BR \*9/dict ).
.PP
.I Adict
is a dictionary browser for
.IR acme (1).
When run with no arguments, it creates a new
.I acme
window named
.B /adict/
listing the installed dictionaries.
Clicking with button 3 on a dictionary name will create
a new empty window named
.BI /adict/ dict /.
Typing and then clicking on a pattern in this window will
create a new lookup window named
.BI /adict/ dict / pattern
containing the dictionary's definition of
.IR pattern .
Clicking with button 3 on any word in this new window will
create new lookup windows.
.PP
If
.I adict
is run with a
.I pattern ,
it starts with the
.BI /adict/ dict / pattern
window.
.PP
If
.I adict
is run with no pattern but with a
.B -d
option,
it starts with the
.BI /adict/ dict /
window.
.SH FILES
.TP
.B \*9/dict
dictionaries
.PD
.SH "SEE ALSO"
.IR regexp (7)
.SH SOURCE
.B \*9/src/cmd/dict
.br
.B \*9/bin/adict
.SH BUGS
A font with wide coverage of the Unicode Standard
should be used for best results.
(Try
.BR \*9/font/pelm/unicode.9.font .)
.PP
If the
.I pattern
doesn't begin with
a few literal characters, matching takes a long time.
.PP
The dictionaries are not distributed outside Bell Labs,
though see
.B \*9/dict/README
for information on using free dictionaries prepared
by Project Gutenberg.