home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / toolbl / 35 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.7 KB  |  76 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!VALT.HELSINKI.FI!HARMO
  3. X-Envelope-to: TOOLB-L@UAFSYSB.BITNET
  4. Content-transfer-encoding: 7BIT
  5. Priority: normal
  6. X-Pmrqc: 1
  7. X-Mailer: Pegasus Mail v2.3 (R5).
  8. Message-ID: <MAILQUEUE-101.930128131420.384@valt.Helsinki.FI>
  9. Newsgroups: bit.listserv.toolb-l
  10. Date:         Thu, 28 Jan 1993 13:14:20 +0000
  11. Sender:       Asymetrix 'Toolbook' product discussions <TOOLB-L@UAFSYSB.BITNET>
  12. From:         Timo Harmo - SocSci U of Helsinki <HARMO@VALT.HELSINKI.FI>
  13. Subject:      RE: Relationship between Text and Hotwords
  14. Lines: 60
  15.  
  16. > a recordField with the text of a story, where numerous
  17. > words (and phrases) are hotWords.  These hotWords have the text of
  18.  
  19. Hotwords are very inadequately handled by toolbook, let's hope
  20. version 2 will improve their handling.
  21.  
  22. Something along following lines might help
  23.  
  24.  if the object of target is hotword
  25.       set tloc to textfrompoint(loc)
  26.       set locenv to characters tloc-20 to tloc+20
  27.       --assuming hotwords are never longer than 20 chars
  28.       --replace by something more elegant
  29.       --this puts the text surrounding the target hotword
  30.       --to locenv
  31.       put offset(text of target, locenv)+tloc-20 to locstart
  32.       -- plus or minus one maybe, these are always a drag to
  33.       -- figure out
  34.       put locstart+charcount(text of target) to locend
  35.       system tarhot
  36.       system tarloc
  37.       set tarloc to locstart &","& locend
  38.       set tarhot to target
  39.     --now you have the hotword and it's location in text
  40.     --  in memory to be used by later scripts
  41.   end if
  42.  
  43.  
  44.  
  45. Another idea might be to search the hotword texts one by one
  46. until you have found the hotword that is the target of current action
  47.    put the objects of recordField "Text" into objList -- the hotwords
  48.    put the target into tofind
  49.    put 0 into lastfound
  50.    while found is not tofind
  51.      pop item 1 of objlist into found
  52.      search page for text of found in recordfield "text"
  53.        while item 5 of selectedtextstate is not ...
  54.         .. or item 1 of selectedtext<lastfound
  55.         -- testing that the text found is a hotword
  56.         --and that is located after the previous hotword
  57.          search again
  58.        end while
  59.       set lastfound to item 1 of selectedtextstate
  60.   end while
  61.   --now the selectedtext should be the text of your hotword
  62.  -- what happens if you do:
  63.   set the selectedtext to newtext
  64.  
  65. >  Any other ideas?  Any hope for something better in version 2.0?
  66. These were just crude untested suggestions.
  67. There has to be improvements in 2.0. This is the weakest part in
  68. Toolbook in my opinion.
  69. >
  70. >  Terry Butler  CALL/Humanities Computing Coordinator
  71.  
  72. I'll try that also:
  73.  
  74.  Timo Harmo, U of Helsinki / Social Science Computing Coordinator
  75.  (yes, it sounds nice)
  76.