home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!VALT.HELSINKI.FI!HARMO
- X-Envelope-to: TOOLB-L@UAFSYSB.BITNET
- Content-transfer-encoding: 7BIT
- Priority: normal
- X-Pmrqc: 1
- X-Mailer: Pegasus Mail v2.3 (R5).
- Message-ID: <MAILQUEUE-101.930128131420.384@valt.Helsinki.FI>
- Newsgroups: bit.listserv.toolb-l
- Date: Thu, 28 Jan 1993 13:14:20 +0000
- Sender: Asymetrix 'Toolbook' product discussions <TOOLB-L@UAFSYSB.BITNET>
- From: Timo Harmo - SocSci U of Helsinki <HARMO@VALT.HELSINKI.FI>
- Subject: RE: Relationship between Text and Hotwords
- Lines: 60
-
- > a recordField with the text of a story, where numerous
- > words (and phrases) are hotWords. These hotWords have the text of
-
- Hotwords are very inadequately handled by toolbook, let's hope
- version 2 will improve their handling.
-
- Something along following lines might help
-
- if the object of target is hotword
- set tloc to textfrompoint(loc)
- set locenv to characters tloc-20 to tloc+20
- --assuming hotwords are never longer than 20 chars
- --replace by something more elegant
- --this puts the text surrounding the target hotword
- --to locenv
- put offset(text of target, locenv)+tloc-20 to locstart
- -- plus or minus one maybe, these are always a drag to
- -- figure out
- put locstart+charcount(text of target) to locend
- system tarhot
- system tarloc
- set tarloc to locstart &","& locend
- set tarhot to target
- --now you have the hotword and it's location in text
- -- in memory to be used by later scripts
- end if
-
-
-
- Another idea might be to search the hotword texts one by one
- until you have found the hotword that is the target of current action
- put the objects of recordField "Text" into objList -- the hotwords
- put the target into tofind
- put 0 into lastfound
- while found is not tofind
- pop item 1 of objlist into found
- search page for text of found in recordfield "text"
- while item 5 of selectedtextstate is not ...
- .. or item 1 of selectedtext<lastfound
- -- testing that the text found is a hotword
- --and that is located after the previous hotword
- search again
- end while
- set lastfound to item 1 of selectedtextstate
- end while
- --now the selectedtext should be the text of your hotword
- -- what happens if you do:
- set the selectedtext to newtext
-
- > Any other ideas? Any hope for something better in version 2.0?
- These were just crude untested suggestions.
- There has to be improvements in 2.0. This is the weakest part in
- Toolbook in my opinion.
- >
- > Terry Butler CALL/Humanities Computing Coordinator
-
- I'll try that also:
-
- Timo Harmo, U of Helsinki / Social Science Computing Coordinator
- (yes, it sounds nice)
-