May 2, 2001; Stephen B. Wampler, modified by Ralph E. Griswold
This file is in the public domain.
NOTE: This is a specialized version used for producing kwic listings
for the Icon program library.
This is a simple keyword-in-context (KWIC) program. It reads from
standard input and writes to standard output. The "key" words are
aligned at a specified column, with the text shifted as necessary. Text
shifted left is truncated at the left. Tabs and other characters whose
"print width" is less than one may not be handled properly.
The following options are supported:
-c i column at which keywords are aligned, default 30
-h i width of identifying column at left, default 20
Some noise words are omitted (see "exceptions" in the program text).
If a file named except.wrd is open and readable in the current directory,
the words in it are used instead.
This program is pretty simple. Possible extensions include ways
of specifying words to be omitted, more flexible output formatting, and
so on. Another "embellisher's delight".
Source code |
Program Library Page |
Icon Home Page