Q: Why do some files have their filename in boldface in the summary view of Librarian?\
\
Q: Why don't RTF files have have their filename in the summary view?\
\
\
A: First, a brief explanation of the procedure Librarian uses to index a directory. It checks each file to determine if it should be indexed. Some files, binary files for example, are not indexed. If the file will be indexed, Librarian determines its filetype, such as ascii, troff, rtf, etc. Librarian uses
\i /usr/lib/indexing/fileType
\i0 (not
\i /bin/file
\i0 ) to determine the filetype of a file.\
\
The filetype determines how Librarian will build the description (the line in the summary view) and how it will filter the file so that the right words go into the index. It uses
\i /usr/lib/indexing/<type>-desc
\i0 to create a description, and
\i /usr/lib/indexing/<type>-keys
\i0 to filter the file. For example, if a file is of type rtf, then
\i /usr/lib/indexing/rtf-desc
\i0 is used to create the description and
\i /usr/lib/indexing/rtf-keys
\i0 is used to filter the file. If there is not a description or keyword file for a filetype, a default mechanism is used. The default description is simply the first 80 characters in the file. The default keyword extraction program is
\i pword
\i0 .\
\
Now, getting back to the original question : Why do some ASCII files have their name in boldface, while others do not? Files of the type
\i english
\i0 have boldface filenames, type
\i ascii
\i0 files do not. There is a description program for
\i english
\i0 files –
\i /usr/lib/indexing/english-desc
\i0 – which boldfaces the filename. There is no description program for
\i ascii
\i0 files. If you want
\i ascii
\i0 files to boldface the filename in the description like
\i english
\i0 files, you can link
\i /usr/lib/indexing/ascii-desc
\i0 to
\i /usr/lib/indexing/english-desc.\
\i0 \
The answer to the second question is that the default description for
\i rtf
\i0 files doesn't include the filename. If you want to include one, you can fix it by doing the following:\
\f1\fs24 % cd /usr/lib/indexing\
% mv rtf-desc rtf-desc.orig\
% cat > rtf-desc\
#! /bin/sh\
#\
# Add file name to beginning of RTF description\
# \
FileName=`echo $\{1\} | sed -e 's-^\\./--'`\
echo "$\{FileName\}: `$\{0\}.orig $\{1\}`"\
^D\
%\
\f0\i\fs28 \
\i0 Note that modifying the description or keyword files only affects index building. The descriptions are stored in the index, not in the actual files.\
\
To create your own description program, you need to write a program or script that takes the filename as an argument and prints the description to
\i stdout
\i0 . If you want to put make font changes, the character \\001 turns bold on and \\002 turns it off. Read the indexing paper mentioned below if you want to do something other than replace an existing description program.\
\
To create your own keyword extraction program, you need to write a program or script that takes a filename as the argument and prints out
\b word weight
\b0 pairs — see
\i pword
\i0 for an example. Often the simplest thing to do is output a list of words and run that list through pword — see
\i /usr/lib/indexing/rtf-keys
\i0 .\
\
If you want more information about the internals of the indexing machinery, please read the
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 paper in