Texis Web Script source code for: /texis/site/demos/oxford.vs
Note: Click on links to view the documentation for HTML tags which are special to the Vortex compiler.
<SCRIPT LANGUAGE=vortex>

<uses demonav=demonav><!--simple look and feel module-->
<entryfunc=init>              <!-- init function for every invocation -->

<!-- --------------------------------------------------------------------- -->
<a name=init private>
  <sum "%s" $SERVER_ROOT "/texis"><db = $ret>  <!-- set the database -->
</a>

<a name=main>
<demolook title="Dictionary Search">
<form method=post action=$url/>
<if $id neq "">
  <sql max=1 "select Word uword,texttomm(Word\Def,100) mlq from oxford where id = $id"></sql>
</if>

<table>

<tr><td align=right>Word:</td><td><input name=uword value="$uword"></td></tr>
<tr><td align=right>Definition:</td><td><input name=udef size=30 value="$udef"> <input name=search type=submit value="Search"></td></tr>
<tr><td></td><td><input type=checkbox name=suffixproc value=1 checked>Stem suffixes limiting minimum size to 
<$mwo = 3 4 5 6 255>
<$mwv = 3 4 5 6 "max">
<select name=minwordlen><options $mwo 5 $mwv></select> characters </td></tr>

<tr><td></td><td><input type=checkbox name=smsuffix value=1>Just plurals and possessives</td></tr>
<tr><td></td><td><input type=checkbox name=rebuild value=1 checked>Check matched morpheme forms</td></tr>
<tr><td></td><td><input type=checkbox name=keepeqvs  value=1      >Include thesaurus terms in search</td></tr>
<tr><td></td><td><input type=checkbox name=see       value=1      >Expand thesaurus words using <b>See</b> references</td></tr>
<tr><td></td><td><input type=checkbox name=keepnoise value=1      >Retain Noise words from query</td></tr>
</table>
</form>
<if $id neq  "">
   <search>
<else>
   <if $search neq "">
     <search>
   <else>
     This code example shows some of the linguistic manipulation abilities of Texis and Metamorph  within a web script.
     <a href=/site/vortexman/apicp.html>click here
     for more information on these controls.</a>
   </if>
</if>
</demolook>
</a>

<a name=search>
<apicp qminwordlen 1>
<if $smsuffix neq "">
  <$tinysuf = "s" "'" >
  <apicp "suffix" $tinysuf>
</if>
<if $see neq "">
  <$keepeqvs = 1>
</if>
<if $suffixproc ne "">
  <apicp "suffixproc" $suffixproc>
</if>
<if $minwordlen ne "">
  <apicp "minwordlen" $minwordlen>
</if>
<if $rebuild ne "">
  <apicp "rebuild" $rebuild>
</if>
<if $keepeqvs ne "">
  <apicp "keepeqvs" $keepeqvs>
</if>
<if $see ne "">
  <apicp "see" $see>
</if>
<if $keepnoise ne "">
  <apicp "keepnoise" $keepnoise> 
</if>

<hr>
<dl>
<if $id eq "">
   <apicp alequivs 1>
   <apicp alwild 1>
   <sql null="" max=100 "select id,Word,Def from oxford where Word like $uword and Def like $udef">
       <if $loop eq 0>
          <center><i>Click on a word to find related words</i></center>
       </if>
       <dt><b><a href=$url/mlt.html?id=$id>$Word</a></b><dd>$Def<p>
   </sql>
   <if $loop eq 0>
      <center><i>No matches</i></center>
   </if>
<else>
   <center><i>Ordered by relevance to query term ($uword)</i></center>
   <sql null="" max=100 "select id,Word,Def from oxford where Def likep $mlq">
       <dt><b><a href=$url?id=$id>$Word</a></b><dd>$Def<p>
   </sql>
 </if>
<if $loop gte 100>
   <p><i>Results cropped to 100 answers</i>
</if>
</dl>

</a>

</script>

Back to the Code Example List

The Source Viewer is also a Code Example.
Click Here to see its source.
Copyright © 1992-1999 Thunderstone Software
Copyright © 2024 Thunderstone Software LLC. All rights reserved.