Drag and Drop CGI | 2
Advanced ICE Configuration
In this section, we show you how to create a thesaurus file and how to customize the search request form.
Thesaurus File Configuration
The thesaurus file is simply a text file that defines relationships between words. The ICE thesaurus supports three relationships:
- Word1 EQ word2: Word1 is EQual to word2.
- Word1 AB word2: Word1 is an ABbreviation of word2.
- Word1 UF word2: Word1 is Used For word2.
The format of the thesaurus file is very simple. A word is placed on a line by itself. On the next line, one or more spaces or tabs are followed by the relation and the alternative word separated by one or more spaces or tabs. Listing 12.4 shows a -simple thesaurus file.
Listing 12.4 A sample ICE thesaurus file
doctor
EQ physician
physician
EQ doctor
doc
AB doctor
doctor
UF doc
ICE is a simple script, so these relationships are not very sophisticated. You must explicitly put in the EQ relations for both eventualities; that is, doctor EQ physician and physician EQ doctor. Also, the relations don't ``chain.'' For example, searching for ``doc'' in Listing 12.4 with substring matching off will match doctor because of the doc AB doctor relation. But it will not match physician by following a chain of doc AB doctor and doctor EQ physician. Nevertheless, the thesaurus function adds a nice bit of help to users searching your Web site. It's not hard to create, and your users will appreciate it. Once you've created and uploaded the file, be sure to edit the ice-form.cgi file to point to its location. We suggest putting the -thesaurus file in the same directory as the index file.
Comments are welcome
Copyright © 1997 Addison-Wesley Pub Co. and
Created: Oct. 24, 1997
Revised: Oct. 27, 1997
URL: http://webreference.com/dev/dndcgi/advance.html




Find a programming school near you