home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / Misc / HigherEducationMailbox.mbox / Archives_provide_val_.attach / May_91 / librarian.528 < prev    next >
Text File  |  1991-05-21  |  4KB  |  98 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw11440
  3. \paperh9000
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 indexing description summary \
  8. \
  9. Q:  Why do some files have their filename in boldface in the summary view of Librarian?\
  10. \
  11. Q:  Why don't RTF files have have their filename in the summary view?\
  12. \
  13. \
  14. 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 
  15. \i /usr/lib/indexing/fileType
  16. \i0  (not 
  17. \i /bin/file
  18. \i0 ) to determine the filetype of a file.\
  19. \
  20. 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 
  21. \i /usr/lib/indexing/<type>-desc
  22. \i0  to create a description, and 
  23. \i /usr/lib/indexing/<type>-keys
  24. \i0  to filter the file.  For example, if a file is of type rtf, then
  25. \i /usr/lib/indexing/rtf-desc
  26. \i0  is used to create the description and  
  27. \i /usr/lib/indexing/rtf-keys
  28. \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 
  29. \i pword
  30. \i0 .\
  31. \
  32. 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 
  33. \i english
  34. \i0  have boldface filenames, type 
  35. \i ascii
  36. \i0  files do not.  There is a description program for 
  37. \i english
  38. \i0  files  –
  39. \i  /usr/lib/indexing/english-desc
  40. \i0  – which boldfaces the filename.  There is no description program for 
  41. \i ascii
  42. \i0  files.  If you want 
  43. \i ascii
  44. \i0  files to boldface the filename in the description like 
  45. \i english
  46. \i0  files, you can link 
  47. \i /usr/lib/indexing/ascii-desc 
  48. \i0 to
  49. \i  /usr/lib/indexing/english-desc.\
  50.  
  51. \i0 \
  52. The answer to the second question is that the default description for 
  53. \i rtf
  54. \i0  files doesn't include the filename.  If you want to include one, you can fix it by doing the following:\
  55.  
  56. \f1\fs24     % cd /usr/lib/indexing\
  57.     % mv rtf-desc rtf-desc.orig\
  58.     % cat > rtf-desc\
  59.     #! /bin/sh\
  60.     #\
  61.     # Add file name to beginning of RTF description\
  62.     # \
  63.     FileName=`echo $\{1\} | sed -e 's-^\\./--'`\
  64.     echo "$\{FileName\}: `$\{0\}.orig $\{1\}`"\
  65.     ^D\
  66.     %\
  67.  
  68. \f0\i\fs28 \
  69.  
  70. \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.\
  71. \
  72. 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 
  73. \i stdout
  74. \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.\
  75. \
  76. 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 
  77. \b word weight
  78. \b0  pairs — see 
  79. \i pword 
  80. \i0 for an example.  Often the simplest thing to do is output a list of words and run that list through pword — see 
  81. \i /usr/lib/indexing/rtf-keys
  82. \i0 .\
  83.  \
  84. If you want more information about the internals of the indexing machinery, please read the 
  85. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 paper in  
  86. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\i\fc0 /NextLibrary/Documentation/NeXT/RelNotes
  87. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 /IndexingPaper.
  88. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0 wn
  89. \i0 .\
  90. \
  91. \
  92. QA528\
  93. \
  94. Valid for 1.0 \
  95. Not vaild for 2.0\
  96. \
  97.  
  98.