.\" Copyright (c) 1983, 1990 Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)lookbib.1 6.5 (Berkeley) 7/29/91 .\" .Dd July 29, 1991 .Dt LOOKBIB 1 .Os BSD 4.2 .Sh NAME .Nm indxbib , lookbib .Nd build inverted index for a bibliography, find references in a bibliography .Sh SYNOPSIS .Nm indxbib .Ar database ... .Nm lookbib .Op Fl n .Ar database .Sh DESCRIPTION .Nm Indxbib builds an inverted index to the named .Ar databases (or files), which can then be used by .Nm lookbib and .Xr refer 1 . The files are assumed to be .Xr refer style bibliographic databases (see .Xr addbib 1 ) . .Pp .Nm Indxbib is a shell script which calls .Nm mkey and .Nm inv . The first program, .Nm mkey , truncates words to 6 characters, and maps upper case to lower case. It also discards words shorter than 3 characters, words among the 100 most common English words, and numbers (dates) < 1900 or > 2000. These parameters can be changed; see page 4 of a .Em Refer document by Mike Lesk (See the SEE ALSO section below). The second program, .Nm inv , creates an entry file .Pq Ar file Ns .ia , a posting file .Pq Ar file Ns .ib , and a tag file .Pq Ar file Ns .ic , all in the working directory. .Pp .Nm Lookbib uses an inverted index made by .Nm indxbib to find sets of bibliographic references. It reads keywords typed after the ``>'' prompt on the terminal, and retrieves records containing all these keywords. If nothing matches, nothing is returned except another ``>'' prompt. .Pp .Nm Lookbib will ask if you need instructions, and will print some brief information if you reply ``y''. The .Fl n flag turns off the prompt for instructions. .Pp It is possible to search multiple databases, as long as they have a common index made by .Nm indxbib . In that case, only the first argument given to .Nm indxbib is specified to .Nm lookbib . .Pp If .Nm lookbib does not find the index files (the .Ar file Ns .i[abc] files), it looks for a reference file with the same name as the argument, without the suffixes. It creates a file with a `.ig' suffix, suitable for use with .Xr fgrep 1 . It then uses this fgrep file to find references. This method is simpler to use, but the .Ar file Ns ig is slower to use than the .Ar file Ns .i[abc] files, and does not allow the use of multiple reference files. .Sh FILES .Bl -tag -width /usr/libexec/mkey -compact .It Pa \&*.ia Entry file. .It Pa \&*.ib Posting file. .It Pa \&*.ic Tag file. .It Pa \&*.ig Ascii file created if index files not found. .It Pa /usr/libexec/mkey Make keys program. .It Pa /usr/libexec/inv Hash and invert program. .El .Sh SEE ALSO .Xr refer 1 , .Xr addbib 1 , .Xr sortbib 1 , .Xr roffbib 1 , .Xr lookbib 1 .Sh BUGS More than one blank line in between citations can wreak havoc. .Pp Probably all dates should be indexed, since many disciplines refer to literature written in the 1800s or earlier. .Sh HISTORY A .Nm lookbib command appeared in .At 32v .