home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / 1499 < prev    next >
Encoding:
Internet Message Format  |  1992-12-25  |  6.0 KB

  1. Xref: sparky comp.text:1499 comp.text.sgml:1238
  2. Newsgroups: comp.text,comp.text.sgml
  3. Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!uw-beaver!fluke!inc
  4. From: inc@tc.fluke.COM (Gary Benson)
  5. Subject: Re: Marking up 'Automatically' -anyone
  6. Message-ID: <1992Dec25.230745.16019@tc.fluke.COM>
  7. Organization: John Fluke Mfg. Co., Inc., Everett, WA
  8. References: <20186.2b362c76@ul.ie> <19921223.044835.214@almaden.ibm.com>
  9. Date: Fri, 25 Dec 1992 23:07:45 GMT
  10. Lines: 110
  11.  
  12. In article <19921223.044835.214@almaden.ibm.com> drmacro@ralvm13.VNET.IBM.COM writes:
  13. >In <20186.2b362c76@ul.ie> murraya@ul.ie writes:
  14. >>Can anybody give me details on an application to mark-up text from ordinary
  15. >>ascii files 'automatically', using certain Rules  eg. two blank lines
  16. >>indicates the begining of a paragraph.
  17. >>
  18. >>Any  information on the subject would be appreciated!
  19. >>
  20. >>  <Aonghus>
  21. >>
  22. >
  23. >There are a number of products that can do this.  I'm aware
  24. >of the following vendors:
  25. >
  26. >Avalanche Technology:  FastTag and SGML Hammer products.
  27. >IBM:   TextTagger/ESA, which is based on Avalanche's technology.
  28. >Zandar Corp:  TagWrite for Windows
  29. >Software Exoterica:  Omnimark
  30. >
  31.  
  32. [ Remainder of posting (deleted) describes these products in more detail]
  33.  
  34. Another alternative is to code it up yourself. Here at Fluke, we have been
  35. standardizing our input file format since the days of typesetting made it
  36. seem like a good idea to give consistent input to the typographer.
  37.  
  38. Later, we automated most of the typesetting function using the technique you
  39. are asking about. This was at the exact moment of the debut of the Perl
  40. programming language, a natural for doing this kind of work. Here is how the
  41. man page starts: "Perl is an interpreted language optimized for scanning
  42. arbitrary text files, extracting information from those files, and
  43. generating reports based on that information."
  44.  
  45. Now that we are using SGML style of tagging for files we send into our Agfa
  46. CAPS publishing system, we are continually refining our programs and the
  47. input file format. The main reason we decided to roll our own was that none
  48. of the companies mentioned in this reply existed at the time that we had
  49. this need.
  50.  
  51. One thing to be aware of if you begin donw the road of automatic tagging, is
  52. that you should probably be ready to accept your decision long-term and be
  53. willing to commit to it. This is true whether you intend to write your own
  54. auto-gencoder or buy one. For example, I understand that FastTag from
  55. Avalanche uses a "Visual Recognition Engine" and some AI techniques to
  56. generate their output. This implies that you must have a way to feed it
  57. visually consistent hardcopy, and that you are willing to buy into that
  58. technique with whatever inherent weaknesses it might have.
  59.  
  60. Our method on the other hand, scanning ASCII text files, requires a real
  61. commitment, too, as well as the discipline involved in preparing the files.
  62.  
  63. To give a picture of how our "gentext" program works, we have some general
  64. rules about files submitted for processing:
  65.  
  66.     1. Standard text paragraphs must start at the left margin.
  67.  
  68.     2. Structural headings start at the margin and indicate their level with
  69.        the unique string ---n where n can be a number between 0 (Chapter)
  70.        and 4.
  71.  
  72.     2. Lists must occur at a new tab stop for each level of nesting.
  73.      A. Like this.
  74.      B. Or this.
  75.  
  76.     3. Figure and Table titles must be on a line alone, separated above and
  77.        below by a blank line, and at a different indent than the immediately
  78.        preceeding object.
  79.  
  80.     4. NOTES, CAUTIONS, and WARNINGS must be indicated by the introducer
  81.        word on a line by itself, a blank line, then the body of the NCW at a
  82.        consistent indent, and one that is different from any object below.
  83.  
  84. Using these general rules, we have a program scan the text one line at a
  85. time and check it for compliance with the definition of each of object.  If
  86. an object meets the definition of an object that includes indention, any
  87. text at that indent is tucked away until the indent changes. In this way, we
  88. keep track of list nesting, and multiple paragraph ojects. The default
  89. object is the standard text paragraph, so the program is fairly efficient.
  90. As a line is examined, gentext says, "is it a heading, is it a figure title,
  91. is it a NOTE, is it a numeric list???" and so on. As long as the answer is
  92. no, it just keeps checking. At the bottom, if everything else was no, then
  93. it must be a pragraph, and the line just goes to the output. Only when it
  94. does a check for an object, say "NOTE" do things slow down. If for example,
  95. it finds the workd NOTE alone on a line, it sets up some memory and begins
  96. shoveling following text into it as long as the indent does not change. The
  97. moment it does, the memory area is dumped to the output file, followed by the
  98. </note> code. Then the next line is examined.
  99.  
  100. I only mention writing your own program as an alternative because I do not
  101. think that we are unique in having our own special requirements and wants.
  102. We are certainly interested in looking at commmercially available products,
  103. but it may take them a while to reach the level of sophistication and
  104. extensibility we have now. Besides, by doing it ourselves, the software is
  105. completely accessible, something you definitely give up when you buy someone
  106. else's idea of the way it should be done!
  107.  
  108. I am not trying to convince anyone of the relative merits of any particular
  109. approach, just affirming that the idea murraya@ul was asking about is indeed
  110. a viable way to tag files. I am looking forward to seeing what WordPerfect
  111. Markup looks like, too. A "tagging assistant" might be another way to get
  112. results conforming to your needs.
  113.  
  114. -- 
  115. Gary Benson   -_-_-_-_-_-_-_-_-_-inc@sisu.fluke.com_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  116.  
  117. Stupidity cannot be cured with money, or through education, or by legislation. 
  118. Stupidity is not a sin; the victim can't help being stupid. But stupidity
  119. is the only universal capital crime; the sentence is death, there is no
  120. appeal, and execution is carried out automatically and without pity.
  121.                                                    -Lazarus Long
  122.