home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / text / sgml / 925 < prev    next >
Encoding:
Text File  |  1992-07-23  |  3.8 KB  |  102 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!RALVM13.VNET.IBM.COM!DRMACRO
  2. From: DRMACRO@RALVM13.VNET.IBM.COM ("Dr. "Eliot Kimber" Macro")
  3. Newsgroups: comp.text.sgml
  4. Subject: Identifying Overlaps
  5. Message-ID: <9207231518.AA22593@ucbvax.Berkeley.EDU>
  6. Date: 23 Jul 92 14:37:31 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 92
  9.  
  10. Darrell Raymond writes:
  11.  
  12. >  Once again, consider the markup of a stream with overlapping elements
  13. >(three elements this time).
  14. >
  15. >  Here is the text:
  16. >
  17. >    now is the time for all good
  18. >
  19. >  And the contents of each element (and of their overlaps) is defined as
  20. >follows (where the operator "^" means intersection):
  21. >
  22. >  X:    now is the for
  23. >  Y:     is the for all
  24. >  Z:     the for all good   <-- Typo?  Should Z contain 'the'?
  25. >  X^Y:    is for
  26. >  X^Z:    the for
  27. >  Y^Z:    for all
  28. >  X^Y^Z: for
  29. >
  30. >  Note that the elements are not contiguous subsequences of text.  If
  31. >you draw a Venn diagram with three overlapping circles and put the words
  32. >in the various regions as the element membership requires, it might be
  33. >easier to visualize.  Never mind that it seems bizarre.
  34. >
  35. >  Now, the markup problem I pose is the following: insert tags in the
  36. >text, corresponding to X, Y, and Z, that demarcate the various regions
  37. >in such a way that a "reasonable" person or program can identify all
  38. >the elements and overlaps, and would not infer non-existent relationships.
  39. >
  40. >-Darrell.
  41. >
  42.  
  43. First, here's a visual representation of the overlap, to make
  44. sure I've got it right
  45.  
  46.                        and X contains 'for'?
  47. X  now is the for
  48. Y      is the for all
  49. Z             for all good      (Assuming Z does not contain 'the')
  50.  
  51. The obvious solution is Michael's use of non-containing marker
  52. elements, which the parser cannot validate but that an
  53. application can:
  54.  
  55. <x start>now <y start>is the <z start>for<x end> all<y end> good<z start>
  56.  
  57. If the markup didn't all have to be embeded in the string itself
  58. I could use HyTime location functions to define each of the spans
  59. (or DSSSL location function), or define my own markup that
  60. did so.  I could also define indirect methods where I identify
  61. each different part and then combine them.  I could also define
  62. my processor such that it does string comparisons, with something
  63. like this:
  64.  
  65. <text id=x>now is the for</>
  66. <text id=y>is the for all</>
  67. <text id=z>for all good</>
  68. <intersect refids='x y'>X intersect Y
  69. <intersect refids='x z'>X intersect Z
  70. <intersect refids='y z'>Y intersect Z
  71. <intersect refids='x y z'>X intersect Y intersect Z
  72.  
  73. Where the processor would compare the the strings referenced
  74. left to right to find matches and report the result.
  75.  
  76. I could also define a "delta-chain" structure, like so:
  77.  
  78. <text id=base>now is the for</>
  79. <text id=x refid=base><!-- No change as x=base -->
  80. <text id=y refid=x><deletion start=1 len=4><text>all</text></text>
  81. <text id=z refid=y><deletion start=1 len=7><text>good</text></text>
  82.  
  83. Here, the DELETION element is not procedural but merely identifies
  84. a deletion using a location method.  The processing of TEXT
  85. is defined such that contained text is appended to referenced
  86. text.  Without writing the program to check, I think there's enough
  87. information above to let you determine the intersections
  88. of any of the defined text strings, as the DELETION information gives
  89. enough information to derive the start and and of each string
  90. relative to others in the chain.
  91.  
  92. I think the first solution meets the letter of Darrell's new
  93. challenge, if not the spirit.  The other solutions demonstrate
  94. other approaches to the problem of identifying relationships
  95. among data elements that are not strictly hierarchical.
  96.  
  97. Eliot Kimber                      Internet:  drmacro@ralvm13.vnet.ibm.com
  98. Dept E14/B500                     IBMMAIL:   USIB2DK9@IBMMAIL
  99. Network Programs Information Development     Phone: 1-919-543-7091
  100. IBM Corporation
  101. Research Triangle Park, NC 27709
  102.