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
|
.TP
filter ["\fIlabel\fP"] [!] /\fIregex\fP/[i]
.br
Sets the filter for the
.I "selected slot"
(which must contain a file and not a combination).
If a filter is set and active for a file, any line matching the given
.I regex
is filtered from the output (if the\&\&!\&\&is put before the
.IR regex ,
any line
.I not
matching the regex is filtered).
The
.I label ,
which isn't required, merely acts as documentation in various diagnostics.
As an example, consider that
.I edict
lines often have\c
.Q (pn)
on them to indicate that the given English is
a place name. Often these place names can be a bother, so it would be
nice to elide them from the output unless specifically requested.
Consider the example:
.nf
lookup command> filter "name" /(pn)/
search [edict]> []
ǽ [Τ] /function/faculty/
Ǽ [Τ] /inductive/
[Τ] /yesterday/
3 "name" lines filtered
.fi
In the example,\&\&/\&\&characters are used to delimit the start and stop
of the regex (as is common with many programs). However, any character
can be used. A final\&\&i\&\&, if present, indicates that the regex should
be applied in a case-insensitive manner.
The filter, once set, can be enabled or disabled with the other form
of the\c
.Q filter
command (described below). It can also be temporarily
turned off (or, if disabled, temporarily turned on) by the\c
.Q !F!
line prefix.
Filtered lines can optionally be saved and then displayed if you so desire.
See the\c
.Q "saved list size"
and\c
.Q show
commands.
Note that if you have saving enabled and only one line would be
filtered, it is simply printed at the end (rather than print a one
line message about how one line was filtered).
By the way, a better\c
.Q name
filter for
.I edict
would be:
.nf
filter "name" #^[^/]+/[^/]*<p[ln]>[^/]*/$#
.fi
as it would filter all entries that had only one English section, that
section being a name. It is also an example of using something other
than\&\&/\&\&to delimit a regex, as it makes things a bit easier
to read.
.TP
filter [\fIboolean\fP]
.br
Enables or disables the filter for the
. IR "selected slot" .
If no argument is given, displays the current filter and status.
|