/* * phpAiksaur - A Web Interface to the AikSaurus Thesaurus Library * Copyright (C) 2001 by Jared Davis * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Define this as the path to your aiksaurus executable: define(EXEC_PATH, "./CommandLineDemo"); // This path also needs to be correct. Usually you just put // phpAiksaurusClass.php in the same directory with this file. include_once("phpAiksaur.php"); define(LINK_URL, $PHP_SELF . "?lookup="); function makeLink($word) { return "$word"; } function printResults($res, $title) { if (count($res) == 0) return; switch( count($res) % 4 ) { case 0: case 3: $stop1 = count($res) / 4; $stop2 = 2 * $stop1; $stop3 = 3 * $stop1; $stop4 = count($res); break; case 1: $stop1 = (count($res) / 4); $stop2 = $stop1 + count($res) / 4; $stop3 = $stop2 + count($res) / 4; $stop4 = count($res); break; case 2: $stop1 = count($res) / 4; $stop2 = 1 + $stop1 + count($res) / 4; $stop3 = $stop2 + count($res) / 4; $stop4 = count($res); break; } print "
| "; print "" . count($res) . " $title"; print " | ";
for($i = 0;$i < $stop1;++$i)
{
print makeLink($res[$i]) . " "; } print " | ";
for(; $i < $stop2; ++$i)
{
print makeLink($res[$i]) . " "; } print " | ";
for(; $i < $stop3; ++$i)
{
print makeLink($res[$i]) . " "; } print " | ";
for(; $i < $stop4; ++$i)
{
print makeLink($res[$i]) . " "; } print " |
Alphabetically nearby known words:"; print "