home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ptx-0.4-bin.lha / info / ptx.info (.txt)
GNU Info File  |  1996-10-12  |  22KB  |  393 lines

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