home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / ptx.info < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  21.8 KB  |  503 lines

  1. This is Info file ptx.info, produced by Makeinfo-1.63 from the input
  2. file ptx.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * ptx: (ptx).        A permuted indexer for GNU.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the `ptx' command, which has the purpose of
  9. generated permuted indices for group of files.
  10.  
  11.    Copyright (C) 1990, 1991, 1993, 1994 Free Software Foundation, Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions, except that this permission notice may be stated in a
  25. translation approved by the Foundation.
  26.  
  27. 
  28. File: ptx.info,  Node: Top,  Next: Invoking ptx,  Prev: (dir),  Up: (dir)
  29.  
  30. GNU `ptx'
  31. *********
  32.  
  33.    GNU `ptx' is the GNU version of the traditional permuted index
  34. generator.  It can handle multiple input files at once, produce TeX
  35. compatible output, and produce readable "KWIC" (KeyWords In Context)
  36. indexes without needing to use `nroff'.  This version does not handle
  37. input files that do not fit in memory all at once.
  38.  
  39.    The GNU `ptx' current (beta) release is 0.4.  Even if quite usable
  40. as it stands, the program specifications are evolving, many
  41. enhancements are planned for the future.  This version is able to
  42. handle small files quickly, while providing a platform for more
  43. development.  However, development priority is low.  *Please note* that
  44. an overall renaming of all options is foreseeable.
  45.  
  46.    The command syntax is not the same as traditional `ptx': all given
  47. files are input files, the results are produced on standard output by
  48. default.
  49.  
  50. * Menu:
  51.  
  52. * Invoking ptx::                How to use this program
  53. * Compatibility::               The GNU extensions to `ptx'
  54.  
  55.  -- The Detailed Node Listing --
  56.  
  57. How to use this program
  58.  
  59. * General options::             Options which affect general program behaviour.
  60. * Charset selection::           Underlying character set considerations.
  61. * Input processing::            Input fields, contexts, and keyword selection.
  62. * Output formatting::           Types of output format, and sizing the fields.
  63.  
  64. 
  65. File: ptx.info,  Node: Invoking ptx,  Next: Compatibility,  Prev: Top,  Up: Top
  66.  
  67. How to use this program
  68. ***********************
  69.  
  70.    This tool reads a text file and essentially produces a permuted
  71. index, with each keyword in its context.  The calling sketch is one of:
  72.  
  73.      ptx [OPTION ...] [FILE ...]
  74.  
  75.    or:
  76.  
  77.      ptx -G [OPTION ...] [INPUT [OUTPUT]]
  78.  
  79.    The `-G' (or its equivalent: `--traditional') option disables all
  80. GNU extensions and revert to traditional mode, thus introducing some
  81. limitations, and changes several of the program's default option values.
  82. When `-G' is not specified, GNU extensions are always enabled.  GNU
  83. extensions to `ptx' are documented wherever appropriate in this
  84. document.  See *Note Compatibility:: for an explicit list of them.
  85.  
  86.    Individual options are explained later in this document.
  87.  
  88.    When GNU extensions are enabled, there may be zero, one or several
  89. FILE after the options.  If there is no FILE, the program reads the
  90. standard input.  If there is one or several FILE, they give the name of
  91. input files which are all read in turn, as if all the input files were
  92. concatenated.  However, there is a full contextual break between each
  93. file and, when automatic referencing is requested, file names and line
  94. numbers refer to individual text input files.  In all cases, the
  95. program produces the permuted index onto the standard output.
  96.  
  97.    When GNU extensions are *not* enabled, that is, when the program
  98. operates in traditional mode, there may be zero, one or two parameters
  99. besides the options.  If there is no parameters, the program reads the
  100. standard input and produces the permuted index onto the standard output.
  101. If there is only one parameter, it names the text INPUT to be read
  102. instead of the standard input.  If two parameters are given, they give
  103. respectively the name of the INPUT file to read and the name of the
  104. OUTPUT file to produce.  *Be very careful* to note that, in this case,
  105. the contents of file given by the second parameter is destroyed.  This
  106. behaviour is dictated only by System V `ptx' compatibility, because GNU
  107. Standards discourage output parameters not introduced by an option.
  108.  
  109.    Note that for *any* file named as the value of an option or as an
  110. input text file, a single dash `-' may be used, in which case standard
  111. input is assumed.  However, it would not make sense to use this
  112. convention more than once per program invocation.
  113.  
  114. * Menu:
  115.  
  116. * General options::             Options which affect general program behaviour.
  117. * Charset selection::           Underlying character set considerations.
  118. * Input processing::            Input fields, contexts, and keyword selection.
  119. * Output formatting::           Types of output format, and sizing the fields.
  120.  
  121. 
  122. File: ptx.info,  Node: General options,  Next: Charset selection,  Prev: Invoking ptx,  Up: Invoking ptx
  123.  
  124. General options
  125. ===============
  126.  
  127. `-C'
  128. `--copyright'
  129.      Prints a short note about the Copyright and copying conditions,
  130.      then exit without further processing.
  131.  
  132. `-G'
  133. `--traditional'
  134.      As already explained, this option disables all GNU extensions to
  135.      `ptx' and switch to traditional mode.
  136.  
  137. `--help'
  138.      Prints a short help on standard output, then exit without further
  139.      processing.
  140.  
  141. `--version'
  142.      Prints the program verison on standard output, then exit without
  143.      further processing.
  144.  
  145. 
  146. File: ptx.info,  Node: Charset selection,  Next: Input processing,  Prev: General options,  Up: Invoking ptx
  147.  
  148. Charset selection
  149. =================
  150.  
  151.    As it is setup now, the program assumes that the input file is coded
  152. using 8-bit ISO 8859-1 code, also known as Latin-1 character set,
  153. *unless* if it is compiled for MS-DOS, in which case it uses the
  154. character set of the IBM-PC.  (GNU `ptx' is not known to work on
  155. smaller MS-DOS machines anymore.)  Compared to 7-bit ASCII, the set of
  156. characters which are letters is then different, this fact alters the
  157. behaviour of regular expression matching.  Thus, the default regular
  158. expression for a keyword allows foreign or diacriticized letters.
  159. Keyword sorting, however, is still crude; it obeys the underlying
  160. character set ordering quite blindly.
  161.  
  162. `-f'
  163. `--ignore-case'
  164.      Fold lower case letters to upper case for sorting.
  165.  
  166. 
  167. File: ptx.info,  Node: Input processing,  Next: Output formatting,  Prev: Charset selection,  Up: Invoking ptx
  168.  
  169. Word selection
  170. ==============
  171.  
  172. `-b FILE'
  173. `--break-file=FILE'
  174.      This option is an alternative way to option `-W' for describing
  175.      which characters make up words.  This option introduces the name
  176.      of a file which contains a list of characters which can*not* be
  177.      part of one word, this file is called the "Break file".  Any
  178.      character which is not part of the Break file is a word
  179.      constituent.  If both options `-b' and `-W' are specified, then
  180.      `-W' has precedence and `-b' is ignored.
  181.  
  182.      When GNU extensions are enabled, the only way to avoid newline as a
  183.      break character is to write all the break characters in the file
  184.      with no newline at all, not even at the end of the file.  When GNU
  185.      extensions are disabled, spaces, tabs and newlines are always
  186.      considered as break characters even if not included in the Break
  187.      file.
  188.  
  189. `-i FILE'
  190. `--ignore-file=FILE'
  191.      The file associated with this option contains a list of words
  192.      which will never be taken as keywords in concordance output.  It
  193.      is called the "Ignore file".  The file contains exactly one word
  194.      in each line; the end of line separation of words is not subject
  195.      to the value of the `-S' option.
  196.  
  197.      There is a default Ignore file used by `ptx' when this option is
  198.      not specified, usually found in `/usr/local/lib/eign' if this has
  199.      not been changed at installation time.  If you want to deactivate
  200.      the default Ignore file, specify `/dev/null' instead.
  201.  
  202. `-o FILE'
  203. `--only-file=FILE'
  204.      The file associated with this option contains a list of words
  205.      which will be retained in concordance output, any word not
  206.      mentioned in this file is ignored.  The file is called the "Only
  207.      file".  The file contains exactly one word in each line; the end
  208.      of line separation of words is not subject to the value of the
  209.      `-S' option.
  210.  
  211.      There is no default for the Only file.  In the case there are both
  212.      an Only file and an Ignore file, a word will be subject to be a
  213.      keyword only if it is given in the Only file and not given in the
  214.      Ignore file.
  215.  
  216. `-r'
  217. `--references'
  218.      On each input line, the leading sequence of non white characters
  219.      will be taken to be a reference that has the purpose of
  220.      identifying this input line on the produced permuted index.  See
  221.      *Note Output formatting:: for more information about reference
  222.      production.  Using this option change the default value for option
  223.      `-S'.
  224.  
  225.      Using this option, the program does not try very hard to remove
  226.      references from contexts in output, but it succeeds in doing so
  227.      *when* the context ends exactly at the newline.  If option `-r' is
  228.      used with `-S' default value, or when GNU extensions are disabled,
  229.      this condition is always met and references are completely
  230.      excluded from the output contexts.
  231.  
  232. `-S REGEXP'
  233. `--sentence-regexp=REGEXP'
  234.      This option selects which regular expression will describe the end
  235.      of a line or the end of a sentence.  In fact, there is other
  236.      distinction between end of lines or end of sentences than the
  237.      effect of this regular expression, and input line boundaries have
  238.      no special significance outside this option.  By default, when GNU
  239.      extensions are enabled and if `-r' option is not used, end of
  240.      sentences are used.  In this case, the precise REGEX is imported
  241.      from GNU emacs:
  242.  
  243.           [.?!][]\"')}]*\\($\\|\t\\|  \\)[ \t\n]*
  244.  
  245.      Whenever GNU extensions are disabled or if `-r' option is used, end
  246.      of lines are used; in this case, the default REGEXP is just:
  247.  
  248.           \n
  249.  
  250.      Using an empty REGEXP is equivalent to completely disabling end of
  251.      line or end of sentence recognition.  In this case, the whole file
  252.      is considered to be a single big line or sentence.  The user might
  253.      want to disallow all truncation flag generation as well, through
  254.      option `-F ""'.  *Note Syntax of Regular Expressions:
  255.      (emacs)Regexps.
  256.  
  257.      When the keywords happen to be near the beginning of the input
  258.      line or sentence, this often creates an unused area at the
  259.      beginning of the output context line; when the keywords happen to
  260.      be near the end of the input line or sentence, this often creates
  261.      an unused area at the end of the output context line.  The program
  262.      tries to fill those unused areas by wrapping around context in
  263.      them; the tail of the input line or sentence is used to fill the
  264.      unused area on the left of the output line; the head of the input
  265.      line or sentence is used to fill the unused area on the right of
  266.      the output line.
  267.  
  268.      As a matter of convenience to the user, many usual backslashed
  269.      escape sequences, as found in the C language, are recognized and
  270.      converted to the corresponding characters by `ptx' itself.
  271.  
  272. `-W REGEXP'
  273. `--word-regexp=REGEXP'
  274.      This option selects which regular expression will describe each
  275.      keyword.  By default, if GNU extensions are enabled, a word is a
  276.      sequence of letters; the REGEXP used is `\w+'.  When GNU
  277.      extensions are disabled, a word is by default anything which ends
  278.      with a space, a tab or a newline; the REGEXP used is `[^ \t\n]+'.
  279.  
  280.      An empty REGEXP is equivalent to not using this option, letting the
  281.      default dive in.  *Note Syntax of Regular Expressions:
  282.      (emacs)Regexps.
  283.  
  284.      As a matter of convenience to the user, many usual backslashed
  285.      escape sequences, as found in the C language, are recognized and
  286.      converted to the corresponding characters by `ptx' itself.
  287.  
  288. 
  289. File: ptx.info,  Node: Output formatting,  Prev: Input processing,  Up: Invoking ptx
  290.  
  291. Output formatting
  292. =================
  293.  
  294.    Output format is mainly controlled by `-O' and `-T' options,
  295. described in the table below.  When neither `-O' nor `-T' is selected,
  296. and if GNU extensions are enabled, the program choose an output format
  297. suited for a dumb terminal.  Each keyword occurrence is output to the
  298. center of one line, surrounded by its left and right contexts.  Each
  299. field is properly justified, so the concordance output could readily be
  300. observed.  As a special feature, if automatic references are selected
  301. by option `-A' and are output before the left context, that is, if
  302. option `-R' is *not* selected, then a colon is added after the
  303. reference; this nicely interfaces with GNU Emacs `next-error'
  304. processing.  In this default output format, each white space character,
  305. like newline and tab, is merely changed to exactly one space, with no
  306. special attempt to compress consecutive spaces.  This might change in
  307. the future.  Except for those white space characters, every other
  308. character of the underlying set of 256 characters is transmitted
  309. verbatim.
  310.  
  311.    Output format is further controlled by the following options.
  312.  
  313. `-g NUMBER'
  314. `--gap-size=NUMBER'
  315.      Select the size of the minimum white gap between the fields on the
  316.      output line.
  317.  
  318. `-w NUMBER'
  319. `--width=NUMBER'
  320.      Select the output maximum width of each final line.  If references
  321.      are used, they are included or excluded from the output maximum
  322.      width depending on the value of option `-R'.  If this option is not
  323.      selected, that is, when references are output before the left
  324.      context, the output maximum width takes into account the maximum
  325.      length of all references.  If this options is selected, that is,
  326.      when references are output after the right context, the output
  327.      maximum width does not take into account the space taken by
  328.      references, nor the gap that precedes them.
  329.  
  330. `-A'
  331. `--auto-reference'
  332.      Select automatic references.  Each input line will have an
  333.      automatic reference made up of the file name and the line ordinal,
  334.      with a single colon between them.  However, the file name will be
  335.      empty when standard input is being read.  If both `-A' and `-r'
  336.      are selected, then the input reference is still read and skipped,
  337.      but the automatic reference is used at output time, overriding the
  338.      input reference.
  339.  
  340. `-R'
  341. `--right-side-refs'
  342.      In default output format, when option `-R' is not used, any
  343.      reference produced by the effect of options `-r' or `-A' are given
  344.      to the far right of output lines, after the right context.  In
  345.      default output format, when option `-R' is specified, references
  346.      are rather given to the beginning of each output line, before the
  347.      left context.  For any other output format, option `-R' is almost
  348.      ignored, except for the fact that the width of references is *not*
  349.      taken into account in total output width given by `-w' whenever
  350.      `-R' is selected.
  351.  
  352.      This option is automatically selected whenever GNU extensions are
  353.      disabled.
  354.  
  355. `-F STRING'
  356. `--flac-truncation=STRING'
  357.      This option will request that any truncation in the output be
  358.      reported using the string STRING.  Most output fields
  359.      theoretically extend towards the beginning or the end of the
  360.      current line, or current sentence, as selected with option `-S'.
  361.      But there is a maximum allowed output line width, changeable
  362.      through option `-w', which is further divided into space for
  363.      various output fields.  When a field has to be truncated because
  364.      cannot extend until the beginning or the end of the current line
  365.      to fit in the, then a truncation occurs.  By default, the string
  366.      used is a single slash, as in `-F /'.
  367.  
  368.      STRING may have more than one character, as in `-F ...'.  Also, in
  369.      the particular case STRING is empty (`-F ""'), truncation flagging
  370.      is disabled, and no truncation marks are appended in this case.
  371.  
  372.      As a matter of convenience to the user, many usual backslashed
  373.      escape sequences, as found in the C language, are recognized and
  374.      converted to the corresponding characters by `ptx' itself.
  375.  
  376. `-M STRING'
  377. `--macro-name=STRING'
  378.      Select another STRING to be used instead of `xx', while generating
  379.      output suitable for `nroff', `troff' or TeX.
  380.  
  381. `-O'
  382. `--format=roff'
  383.      Choose an output format suitable for `nroff' or `troff'
  384.      processing.  Each output line will look like:
  385.  
  386.           .xx "TAIL" "BEFORE" "KEYWORD_AND_AFTER" "HEAD" "REF"
  387.  
  388.      so it will be possible to write an `.xx' roff macro to take care of
  389.      the output typesetting.  This is the default output format when GNU
  390.      extensions are disabled.  Option `-M' might be used to change `xx'
  391.      to another macro name.
  392.  
  393.      In this output format, each non-graphical character, like newline
  394.      and tab, is merely changed to exactly one space, with no special
  395.      attempt to compress consecutive spaces.  Each quote character: `"'
  396.      is doubled so it will be correctly processed by `nroff' or `troff'.
  397.  
  398. `-T'
  399. `--format=tex'
  400.      Choose an output format suitable for TeX processing.  Each output
  401.      line will look like:
  402.  
  403.           \xx {TAIL}{BEFORE}{KEYWORD}{AFTER}{HEAD}{REF}
  404.  
  405.      so it will be possible to write write a `\xx' definition to take
  406.      care of the output typesetting.  Note that when references are not
  407.      being produced, that is, neither option `-A' nor option `-r' is
  408.      selected, the last parameter of each `\xx' call is inhibited.
  409.      Option `-M' might be used to change `xx' to another macro name.
  410.  
  411.      In this output format, some special characters, like `$', `%',
  412.      `&', `#' and `_' are automatically protected with a backslash.
  413.      Curly brackets `{', `}' are also protected with a backslash, but
  414.      also enclosed in a pair of dollar signs to force mathematical
  415.      mode.  The backslash itself produces the sequence `\backslash{}'.
  416.      Circumflex and tilde diacritics produce the sequence `^\{ }' and
  417.      `~\{ }' respectively.  Other diacriticized characters of the
  418.      underlying character set produce an appropriate TeX sequence as
  419.      far as possible.  The other non-graphical characters, like newline
  420.      and tab, and all others characters which are not part of ASCII,
  421.      are merely changed to exactly one space, with no special attempt
  422.      to compress consecutive spaces.  Let me know how to improve this
  423.      special character processing for TeX.
  424.  
  425. 
  426. File: ptx.info,  Node: Compatibility,  Prev: Invoking ptx,  Up: Top
  427.  
  428. The GNU extensions to `ptx'
  429. ***************************
  430.  
  431.    This version of `ptx' contains a few features which do not exist in
  432. System V `ptx'.  These extra features are suppressed by using the `-G'
  433. command line option, unless overridden by other command line options.
  434. Some GNU extensions cannot be recovered by overriding, so the simple
  435. rule is to avoid `-G' if you care about GNU extensions.  Here are the
  436. differences between this program and System V `ptx'.
  437.  
  438.    * This program can read many input files at once, it always writes
  439.      the resulting concordance on standard output.  On the other end,
  440.      System V `ptx' reads only one file and produce the result on
  441.      standard output or, if a second FILE parameter is given on the
  442.      command, to that FILE.
  443.  
  444.      Having output parameters not introduced by options is a quite
  445.      dangerous practice which GNU avoids as far as possible.  So, for
  446.      using `ptx' portably between GNU and System V, you should pay
  447.      attention to always use it with a single input file, and always
  448.      expect the result on standard output.  You might also want to
  449.      automatically configure in a `-G' option to `ptx' calls in
  450.      products using `ptx', if the configurator finds that the installed
  451.      `ptx' accepts `-G'.
  452.  
  453.    * The only options available in System V `ptx' are options `-b',
  454.      `-f', `-g', `-i', `-o', `-r', `-t' and `-w'.  All other options
  455.      are GNU extensions and are not repeated in this enumeration.
  456.      Moreover, some options have a slightly different meaning when GNU
  457.      extensions are enabled, as explained below.
  458.  
  459.    * By default, concordance output is not formatted for `troff' or
  460.      `nroff'.  It is rather formatted for a dumb terminal.  `troff' or
  461.      `nroff' output may still be selected through option `-O'.
  462.  
  463.    * Unless `-R' option is used, the maximum reference width is
  464.      subtracted from the total output line width.  With GNU extensions
  465.      disabled, width of references is not taken into account in the
  466.      output line width computations.
  467.  
  468.    * All 256 characters, even `NUL's, are always read and processed from
  469.      input file with no adverse effect, even if GNU extensions are
  470.      disabled.  However, System V `ptx' does not accept 8-bit
  471.      characters, a few control characters are rejected, and the tilda
  472.      `~' is condemned.
  473.  
  474.    * Input line length is only limited by available memory, even if GNU
  475.      extensions are disabled.  However, System V `ptx' processes only
  476.      the first 200 characters in each line.
  477.  
  478.    * The break (non-word) characters default to be every character
  479.      except all letters of the underlying character set, diacriticized
  480.      or not.  When GNU extensions are disabled, the break characters
  481.      default to space, tab and newline only.
  482.  
  483.    * The program makes better use of output line width.  If GNU
  484.      extensions are disabled, the program rather tries to imitate
  485.      System V `ptx', but still, there are some slight disposition
  486.      glitches this program does not completely reproduce.
  487.  
  488.    * The user can specify both an Ignore file and an Only file.  This
  489.      is not allowed with System V `ptx'.
  490.  
  491.  
  492. 
  493. Tag Table:
  494. Node: Top1019
  495. Node: Invoking ptx2473
  496. Node: General options5200
  497. Node: Charset selection5814
  498. Node: Input processing6689
  499. Node: Output formatting12382
  500. Node: Compatibility18912
  501. 
  502. End Tag Table
  503.