home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
oss
/
cvs-2004
/
bahasa
/
web
/
search.php,v
< prev
next >
Wrap
Text File
|
2003-10-26
|
35KB
|
1,893 lines
head 1.17;
access;
symbols
Initial:1.1.1.1 bule:1.1.1;
locks; strict;
comment @# @;
1.17
date 2003.10.26.01.53.10; author bule; state Exp;
branches;
next 1.16;
1.16
date 2003.10.20.00.21.46; author bule; state Exp;
branches;
next 1.15;
1.15
date 2003.10.18.00.33.42; author bule; state Exp;
branches;
next 1.14;
1.14
date 2003.10.17.00.39.36; author bule; state Exp;
branches;
next 1.13;
1.13
date 2003.10.06.00.39.27; author bule; state Exp;
branches;
next 1.12;
1.12
date 2003.10.01.06.51.30; author bule; state Exp;
branches;
next 1.11;
1.11
date 2003.09.11.05.28.22; author bule; state Exp;
branches;
next 1.10;
1.10
date 2003.09.05.06.42.30; author bule; state Exp;
branches;
next 1.9;
1.9
date 2003.09.04.07.27.00; author bule; state Exp;
branches;
next 1.8;
1.8
date 2003.08.28.20.04.48; author bule; state Exp;
branches;
next 1.7;
1.7
date 2003.08.27.07.17.44; author bule; state Exp;
branches;
next 1.6;
1.6
date 2003.08.26.07.22.38; author bule; state Exp;
branches;
next 1.5;
1.5
date 2003.08.23.23.27.15; author bule; state Exp;
branches;
next 1.4;
1.4
date 2003.08.23.16.07.20; author bule; state Exp;
branches;
next 1.3;
1.3
date 2003.08.21.06.18.07; author bule; state Exp;
branches;
next 1.2;
1.2
date 2003.08.19.19.24.21; author bule; state Exp;
branches;
next 1.1;
1.1
date 2003.08.12.19.18.23; author bule; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2003.08.12.19.18.23; author bule; state Exp;
branches;
next ;
desc
@@
1.17
log
@*** empty log message ***
@
text
@<?
session_start();
require_once("../php/Indonesia.php");
require_once("../php/Web.php");
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Project Name: Bahasa Indonesia Dictionary
// Directory: bahasa/web
// File Name: search.php
// Author(s): John L. Whiteman
// Created: June 23, 2003
// Modified: October 20, 2003
// Description: The purpose of this unrestricted access PHP web
// client page is allow a client to search for words
// in the dictionary.
//
// Copyright (c) 2003 John L. Whiteman
//
// Permission is herby granted, free of charge, to any person obtaining a
// copy of this software, data, and associated documentation files
// (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
$web = new Web();
if ($_SESSION['NODUP_REQUEST_ENTRY']) {
unset($_SESSION['NODUP_REQUEST_ENTRY']);
}
$indonesia = new Indonesia();
$status = $indonesia->get_dictionary_status();
if (
($status["status"] == 1) ||
($status["status"] == 2) ||
($status["status"] == 3)) {
$web->redirect("offline.php");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Bahasa Indonesia Dictionary: Search</title>
<link href="bahasa.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="bahasa.js"></script>
<script language="Javascript" type="text/javascript">
<!--
//////////////////////////////////////////////////////////////////////////////
function verify() {
var stoken = document.search.stoken.value;
stoken = trim(stoken);
if (is_white_space(stoken)) {
alert("You must enter a search value.");
document.search.stoken.focus();
return(false);
}
return(true);
}
//////////////////////////////////////////////////////////////////////////////
// -->
</script>
</head>
<body bgcolor="#fffff2">
<? $web->show_logo("Search"); ?>
<a class="menu" href="reference.php">Reference</a>
|
<a class="menu" href="email.php">Send Us E-mail</a>
|
<a class="menu" href="request.php">Request a New Word</a>
|
<a class="menu" href="admin.php">Administration</a>
<br><br>
<?
$edate = $indonesia->get_english_date();
$idate = $indonesia->get_indonesian_date();
print "<b>${edate} | ${idate}</b>";
$id = uniqid(rand(), true);
?>
<form name="search" method="post" onSubmit='return verify()'>
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<?
$total_words = "";
$errstr = $indonesia->get_count("dictionary", $total_words);
if ($errstr != "") {
print "<td><b>Search Entries:</b>\n";
} else {
$total_words = number_format($total_words);
print "<td><b>Search ${total_words} Entries:</b>\n";
}
?>
</td>
</tr><tr>
<td>
<textarea name="stoken" rows="3" cols="55" wrap="soft"></textarea>
</td>
</tr><tr>
<td>
<input type="radio" name="method" value="exact"
<?
if ($_POST['method'] == "exact") {
print " checked";
}
?>
><a class="help" href="help.php?topic=searching">Exact</a>
<input type="radio" name="method" value="fuzzy"
<?
if (!isset($_POST['method'])) {
print " checked";
} else if (isset($_POST['method'])) {
if ($_POST['method'] == "fuzzy") {
print " checked";
}
}
?>
><a class="help" href="help.php?topic=searching">Fuzzy</a>
<input type="radio" name="method" value="linear"
<?
if (isset($_POST['method'])) {
if ($_POST['method'] == "linear") {
print " checked";
}
}
?>
><a class="help" href="help.php?topic=searching">Multiple Words</a>
</td>
</tr><tr>
<td></td>
</tr><tr>
<td align="right">
<input type="submit" name="language" value="English to Indonesian">
<input type="submit" name="language" value="Indonesian to English">
</td>
</tr>
</table>
<input type="hidden" name="id" value="<?echo ${id};?>">
</form>
<script language="Javascript" type="text/javascript">
<!--
document.search.stoken.focus();
// -->
</script>
<?
if (
($_SESSION['NODUP_SEARCHES']) &&
(isset($_POST['id'])) &&
($_SESSION['NODUP_SEARCHES'] == $_POST['id'])) {
//Do nothing...prevents refresh duplication of last action
} else if (
(isset($_POST['stoken'])) &&
(isset($_POST['method'])) &&
(isset($_POST['id'])) &&
(isset($_POST['language']))) {
if ($_SESSION['NODUP_SEARCHES']) {
unset($_SESSION['NODUP_SEARCHES']);
}
$rc =
search(
$web, $indonesia,
$_POST['stoken'], $_POST['method'], $_POST['language']);
if ($rc == 0) {
$_SESSION['NODUP_SEARCHES'] = $_POST['id'];
}
}
$web->show_footer();
?>
</body>
</html>
<?
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function search($web, $indonesia, $stoken, $method, $language) {
$stoken = trim($stoken);
if ($stoken == "") {
print "You must enter a search value.";
return(-1);
}
$method = trim($method);
if ($method == "") {
print "You must choose a search method.";
return(-1);
}
$language = trim($language);
if ($method == "exact") {
return(
search_exact(
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
} else if ($method == "fuzzy") {
return(
search_fuzzy(
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
} else if ($method == "linear") {
return(
search_linear(
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
}
return;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function search_exact($web, $indonesia, $stoken, $language, $visitor) {
$results = array();
if ($language == "English to Indonesian") {
$language = "English";
} else {
$language = "Indonesian";
}
$errstr =
$indonesia->search_exact(
$results, $stoken, $language, $visitor, "");
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
return(-1);
}
print
"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
"<tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr><tr>\n" .
"<td><b>Results:</b></td>\n" .
"<td><i>$results[total]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Duration:</b></td>\n" .
"<td><i>$results[elasped_time] (s)</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Language:</b></td>\n" .
"<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Method:</b></td>\n" .
"<td><i>$results[method]</i></td>\n" .
"</tr><tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr></table>\n";
if ($results["total"] == 0) {
return(0);
}
print
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n";
$results["alt_language"] = $web->tohtml($results["alt_language"]);
for($i = 0; $i < $results["total"]; $i++) {
$result = $results["results"][$i];
if ($i == 0) {
print
"<tr>\n" .
"<th>$results[alt_language]</th>\n" .
"<th>Part of Speech</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>Spelling</th>\n" .
"<th>Comments</th>\n" .
"</tr><tr>\n" .
"<th colspan=\"5\"><hr>\n" .
"</tr>\n";
}
$result["target"] =
$web->tohtml($result["target"]);
$result["pos"] =
$web->tohtml($result["pos"]);
$result["pronunciation"] =
$web->tohtml($result["pronunciation"]);
//$result["pronunciation_ipa"] =
// $web->tohtml($result["pronunciation_ipa"]);
$result["spelling"] =
$web->tohtml($result["spelling"]);
$result["comments"] =
$web->tohtml($result["comments"]);
//"<td>" . $result["pronunciation"] . " </td>\n" .
print
"<tr>\n" .
"<td>" . $result["target"] . " </td>\n" .
"<td align=\"center\">" . $result["pos"] .
" </td>\n" .
"<td align=\"center\">n/a</td>\n" .
"<td align=\"center\">" . $result["spelling"] .
" </td>\n" .
"<td>" . $result["comments"] . " </td>\n" .
"</tr>\n";
if ($i == $results["total"] - 1) {
print "<tr><td colspan=\"5\"><hr></td></tr>\n";
}
}
print "</table>\n";
return(0);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function search_fuzzy($web, $indonesia, $stoken, $language, $visitor) {
$results = array();
if ($language == "English to Indonesian") {
$language = "English";
} else {
$language = "Indonesian";
}
$errstr =
$indonesia->search_fuzzy(
$results, $stoken, $language, $visitor, "");
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
return(-1);
}
print
"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
"<tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr><tr>\n" .
"<td><b>Results:</b></td>\n" .
"<td><i>$results[total]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Duration:</b></td>\n" .
"<td><i>$results[elasped_time] (s)</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Language:</b></td>\n" .
"<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Method:</b></td>\n" .
"<td><i>$results[method]</i></td>\n" .
"</tr><tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr></table>\n";
if ($results["total"] == 0) {
return(0);
}
print
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n";
$results["language"] = $web->tohtml($results["language"]);
$results["alt_language"] = $web->tohtml($results["alt_language"]);
for($i = 0; $i < $results["total"]; $i++) {
$result = $results["results"][$i];
if ($i == 0) {
print
"<tr>\n" .
"<th>$results[language]</th>\n" .
"<th>$results[alt_language]</th>\n" .
"<th>Part of Speech</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>Spelling</th>\n" .
"<th>Comments</th>\n" .
"</tr><tr>\n" .
"<th colspan=\"6\"><hr>\n" .
"</tr>\n";
}
$result["source"] =
$web->tohtml($result["source"]);
$result["target"] =
$web->tohtml($result["target"]);
$result["pos"] =
$web->tohtml($result["pos"]);
$result["pronunciation"] =
$web->tohtml($result["pronunciation"]);
//$result["pronunciation_ipa"] =
// $web->tohtml($result["pronunciation_ipa"]);
$result["spelling"] =
$web->tohtml($result["spelling"]);
$result["comments"] =
$web->tohtml($result["comments"]);
print
"<tr>\n" .
"<td>" . $result["source"] . " </td>\n" .
"<td>" . $result["target"] . " </td>\n" .
"<td align=\"center\">" . $result["pos"] .
" </td>\n" .
"<td align=\"center\">n/a</td>\n" .
"<td align=\"center\">" . $result["spelling"] .
" </td>\n" .
"<td>" . $result["comments"] . " </td>\n" .
"</tr>\n";
if ($i == $results["total"] - 1) {
print "<tr><td colspan=\"6\"><hr></td></tr>\n";
}
}
print "</table>\n";
return(0);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function search_linear($web, $indonesia, $stokens, $language, $visitor) {
$results = array();
$rlanguage = "";
if ($language == "English to Indonesian") {
$language = "English";
} else {
$language = "Indonesian";
}
$errstr =
$indonesia->search_linear(
$results, $stokens, $language, $visitor);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
return(-1);
}
print
"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
"<tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr><tr>\n" .
"<td><b>Results:</b></td>\n" .
"<td><i>$results[total]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Duration:</b></td>\n" .
"<td><i>$results[elasped_time] (s)</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Language:</b></td>\n" .
"<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Method:</b></td>\n" .
"<td><i>$results[method]</i></td>\n" .
"</tr></table>\n";
print
"<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
"<tr>\n" .
"<td><b>Words:</b></td>\n" .
"<td>$results[total_search_tokens]</td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Words (unique):</b></td>\n" .
"<td>$results[total_search_tokens_unique]</td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Search Score:</b></td>\n" .
"<td>$results[search_score_unique]</td>\n" .
"<td><b> | </b></td>\n" .
"<td><b>Search Score (unique):</b></td>\n" .
"<td>$results[search_score_unique]</b></td>\n" .
"</tr><tr>\n" .
"<td colspan=\"11\"><hr></td>\n" .
"</tr></table>\n";
if ($results["total"] == 0) {
return(0);
}
/*print
"<hr><b>Found the following exact and/or close " .
"match(es) for $results[language] word(s):</b><hr>" .
"$results[search]<hr><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br>\n" .
"<b>Search Score: " .
$results["search_score"] .
"<br>Search Score (Unique Matches): " .
$results["search_score_unique"] .
"<br>Search Words: " . $results["total_search_tokens"] .
"<br>Unique Search Words: " .
$results["total_search_tokens_unique"] .
"<br>Unique Exact Matches: " .
$results["hits_unique"] .
"<br>Unique Possible Matches: " .
$results["maybes_unique"] .
"<br>Unique Misses: " .
$results["misses_unique"] .
"</b><hr>\n";
*/
print
"<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
"<tr>\n" .
"<th>$results[language] / $results[alt_language]</th>\n" .
"<th>Part of Speech</th>\n" .
"<th>Pronunciation</th>\n" .
"<th>Spelling</th>\n" .
"<th>Comments</th>\n" .
"</tr><tr>\n" .
"<th colspan=\"7\"><hr>\n" .
"</tr>\n";
$search_strings = count($results["results"]);
for($i = 0; $i < $search_strings; $i++) {
$token = $web->tohtml($results["results"][$i]["search"]);
print
"<tr>\n" .
"<td colspan=\"5\" align=\"left\">\n" .
"<b>( ${token} )</b></td></tr>\n" .
"<tr>\n";
$matches = count($results["results"][$i]["words"]);
if ($matches == 0) {
print
"<tr>\n" .
"<td colspan=\"5\" align=\"left\">\n" .
"<i>No matches found for this word!</i>\n" .
"</td></tr><tr>\n" .
"<td colspan=\"5\"><hr></td></tr>\n";
continue;
}
for($j = 0; $j < $matches; $j++) {
$source =
$results["results"][$i]["words"][$j]["source"];
$target =
$results["results"][$i]["words"][$j]["target"];
$pos =
$results["results"][$i]["words"][$j]["pos"];
$spelling =
$results["results"][$i]["words"][$j]["spelling"];
$pronunciation =
$results["results"][$i]["words"][$j]["pronunciation"];
// $pronunciation_ipa =
// $results["results"][$i]["words"][$j]
// ["pronunciation_ipa"];
$comments =
$results["results"][$i]["words"][$j]["comments"];
$source = $web->tohtml($source);
$target = $web->tohtml($target);
$pos = $web->tohtml($pos);
$spelling = $web->tohtml($spelling);
$pronunciation = $web->tohtml($pronunciation);
$pronunciation_ipa = $web->tohtml($pronunciation_ipa);
$comments = $web->tohtml($comments);
print
"<tr>\n" .
"<td>${target} </td>\n" .
"<td align=\"center\">${pos} </td>\n" .
"<td align=\"center\">n/a</td>\n" .
"<td align=\"center\">${spelling} </td>\n" .
"<td>${comments} </td>\n" .
"</tr>\n";
}
print "<tr><td colspan=\"5\"><hr></td></tr>\n";
}
print "</table>\n";
return(0);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
?>
@
1.16
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 17, 2003
d94 1
a94 1
<body>
d97 1
a97 1
<a href="reference.php">Reference</a>
d99 1
a99 1
<a href="email.php">Send Us E-mail</a>
d101 1
a101 1
<a href="request.php">Request a New Word</a>
d103 1
a103 1
<a href="admin.php">Administration</a>
d152 1
a152 1
><b>Exact</b>
d170 1
a170 1
><b>Fuzzy</b>
d184 1
a184 1
><b>Multiple Words</b>
@
1.15
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 16, 2003
d60 2
d65 2
@
1.14
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 15, 2003
d64 2
d67 2
a68 26
function is_white_space(stoken) {
if (stoken == null) return(true);
if (stoken == '') return(true);
if (stoken == "") return(true);
return(false);
}
function trim(stoken) {
if (is_white_space(stoken)) {
return(stoken);
}
stoken = stoken.replace(/^\s*/, "");
stoken = stoken.replace(/\s*$/, "");
return(stoken);
}
d86 2
d195 1
d197 1
@
1.13
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: October 05, 2003
d128 1
d133 18
a150 1
<td><b>Enter Search Word(s):</b>
d247 2
@
1.12
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 30, 2003
d111 1
a111 1
<h2>Bahasa Indonesia Dictionary: Search</h2>
d132 1
a132 1
<td colspan="2"><b>Enter Search Word(s):</b>
d135 1
a135 1
<td colspan="2">
d145 2
a146 1
print " checked>\n";
d148 1
a148 1
} else {
d150 1
a150 9
print ">\n";
}
?>
</td>
<td>
<b>Search dictionary for exact matches only (single word or phrase)</b>
</td>
</tr><tr>
<td>
d152 1
d156 1
a156 1
print " checked>\n";
d162 1
a162 5
print " checked>\n";
} else {
print ">\n";
d165 1
d167 2
a168 6
</td>
<td>
<b>Search dictionary for exact and/or close matches (single word or phrase)</b>
</td>
</tr><tr>
<td>
d170 1
d176 1
a176 5
print " checked>\n";
} else {
print ">\n";
d179 1
d181 2
a182 5
</td>
<td>
<b>
Search dictionary for exact and/or close matches (multiple words or phrases)<br>
</b>
d185 1
a185 1
<td colspan="2"></td>
d187 1
a187 1
<td align="right" colspan="2">
a234 1
//
d305 19
a326 7
print
"<hr><b>\n" .
"Found 0 matches for $results[language] word(s): " .
"$results[search]</b><br><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br><hr>\n";
a330 7
"<hr><b>Found $results[total] exact " .
"match(es) for $results[language] word(s):</b><hr>" .
"$results[search]<hr><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br><hr>\n";
print
d370 2
d376 5
a380 3
"<td>" . $result["pos"] . " </td>\n" .
"<td>" . $result["pronunciation"] . " </td>\n" .
"<td>" . $result["spelling"] . " </td>\n" .
d386 1
a386 1
print "<tr><td colspan=\"6\"><hr></td></tr>\n";
d420 20
a441 8
print
"<hr><b>\n" .
"Found 0 exact and/or close matches for " .
"$results[language] word(s): " .
"$results[search]</b><br><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br><hr>\n";
a445 7
"<hr><b>Found $results[total] exact and/or close " .
"match(es) for $results[language] word(s):</b><hr>" .
"$results[search]<hr><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br><hr>\n";
print
d496 5
a500 3
"<td>" . $result["pos"] . " </td>\n" .
"<td>" . $result["pronunciation"] . " </td>\n" .
"<td>" . $result["spelling"] . " </td>\n" .
d542 36
a579 8
print
"<hr><b>\n" .
"Found 0 exact and/or close matches for " .
"$results[language] word(s): " .
"$results[search]</b><br><b>\n" .
"Search Duration: " . $results["elasped_time"] .
" second(s)</b><br><hr>\n";
d583 1
a583 1
print
d603 1
d684 3
a686 3
"<td>${pos} </td>\n" .
"<td>${pronunciation} </td>\n" .
"<td>${spelling} </td>\n" .
@
1.11
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 08, 2003
d40 1
a40 1
if (session_is_registered("NODUP_REQUEST_ENTRY")) {
d42 1
a42 1
session_unregister("NODUP_REQUEST_ENTRY");
d220 1
a220 1
(session_is_registered("NODUP_SEARCHES")) &&
d232 1
a232 1
if (session_is_registered("NODUP_SEARCHES")) {
d234 1
a234 1
session_unregister("NODUP_SEARCHES");
d244 1
a244 3
$NODUP_SEARCHES = $_POST['id'];
session_register("NODUP_SEARCHES");
@
1.10
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 04, 2003
d110 1
a110 1
<body bgcolor="#CCCC99">
d117 1
a117 1
<a href="request.php">Request a New Entry</a>
d178 1
a178 1
<b>Search dictionary for exact and/or close matches (single word or phrases)</b>
@
1.9
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: September 03, 2003
d110 1
a110 1
<body>
d127 1
d132 1
a132 1
<td colspan="2">Enter Search Word(s):
d136 1
a136 1
<textarea name="stoken" rows="5" cols="55" wrap="soft"></textarea>
d154 1
a154 1
Search dictionary for exact matches only
d178 1
a178 1
Search dictionary for exact and/or close matches
d198 3
a200 2
Search dictionary for multiples words or sentences sequentially <br>
displaying matches as they are encountered
d212 1
d219 6
d226 1
a226 1
if (
d229 1
d232 1
a232 1
$TOKEN = $_POST['stoken'];
d234 2
a235 3
$METHOD = $_POST['method'];
$LANGUAGE = $_POST['language'];
d237 1
d241 7
d265 1
a265 1
return;
d274 1
a274 1
return;
d281 1
d283 1
a283 1
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
d287 1
d289 1
a289 1
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
d293 1
d295 1
a295 1
$web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
d323 1
a323 1
return;
d336 1
a336 1
return;
d404 1
a404 1
return;
d429 1
a429 1
return;
d442 1
a442 1
return;
d517 1
a517 1
return;
d544 1
a544 1
return;
d557 1
a557 1
return;
d672 1
a672 1
return;
@
1.8
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 28, 2003
a341 1
"<th>International</th>\n" .
d345 1
a345 1
"<th colspan=\"6\"><hr>\n" .
d358 2
a359 2
$result["pronunciation_ipa"] =
$web->tohtml($result["pronunciation_ipa"]);
a371 1
"<td>" . $result["pronunciation_ipa"] . " </td>\n" .
d378 1
a378 1
print "<tr><td colspan=\"7\"><hr></td></tr>\n";
a450 1
"<th>International</th>\n" .
d454 1
a454 1
"<th colspan=\"7\"><hr>\n" .
d470 2
a471 2
$result["pronunciation_ipa"] =
$web->tohtml($result["pronunciation_ipa"]);
a484 1
"<td>" . $result["pronunciation_ipa"] . " </td>\n" .
d491 1
a491 1
print "<tr><td colspan=\"7\"><hr></td></tr>\n";
a566 1
"<th>International</th>\n" .
d581 1
a581 1
"<td colspan=\"6\" align=\"left\">\n" .
d591 1
a591 1
"<td colspan=\"6\" align=\"left\">\n" .
d594 1
a594 1
"<td colspan=\"6\"><hr></td></tr>\n";
d616 3
a618 3
$pronunciation_ipa =
$results["results"][$i]["words"][$j]
["pronunciation_ipa"];
d639 5
a643 6
"<td>${target}</td>\n" .
"<td>${pos}</td>\n" .
"<td>${pronunciation}</td>\n" .
"<td>${pronunciation_ipa}</td>\n" .
"<td>${spelling}</td>\n" .
"<td>${comments}</td>\n" .
d647 1
a647 1
print "<tr><td colspan=\"6\"><hr></td></tr>\n";
@
1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 26, 2003
a140 3
if (!isset($_POST['method'])) {
print " checked>\n";
d142 1
a142 1
} else if ($_POST['method'] == "exact") {
d159 5
a163 1
if (isset($_POST['method'])) {
@
1.6
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 25, 2003
d320 2
a321 2
"match(es) for $results[language] word(s): " .
"$results[search]</b><br><b>\n" .
d428 2
a429 2
"match(es) for $results[language] word(s): " .
"$results[search]</b><br><b>\n" .
d544 3
a546 3
"<hr><b>Found $results[total] exact and/or close " .
"match(es) for $results[language] word(s): " .
"$results[search]</b><br><b>\n" .
d548 15
a562 1
" second(s)</b><br><hr>\n";
@
1.5
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 23, 2003
a284 2
$rlanguage = "";
a287 2
$language_flag = 0;
a291 2
$language_flag = 1;
d320 1
a320 1
"matches for $results[language] word(s): " .
a392 2
$rlanguage = "";
a395 2
$language_flag = 0;
a399 2
$language_flag = 1;
a412 1
d428 1
a428 1
"matches for $results[language] word(s): " .
d504 1
a504 1
function search_linear($web, $indonesia, $stoken, $language, $visitor) {
a509 8
$exact_matches = 0;
$maybe_matches = 0;
$misses = 0;
$total_searched_words = 0;
a513 4
$rlanguage = "Indonesian";
$language_flag = 0;
a516 4
$rlanguage = "English";
$language_flag = 1;
d519 3
a521 2
$errstr =
$indonesia->search_linear($results, $stoken, $language);
d530 1
a530 1
$matches = count($results);
d532 7
a538 7
if ($matches == 0) {
print "<br><hr><b>Found ${matches} matches!</b><hr><br>\n";
$errstr =
$indonesia->log_search(
$visitor, $language_flag, 2, $exact_matches, $maybe_matches);
d543 6
a548 10
$parts_of_speech = array();
$errstr = $indonesia->get_parts_of_speech($parts_of_speech);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
return;
}
d550 1
a550 1
print
d553 1
a553 3
"<th colspan=\"6\" align=\"left\">[${language}]</th>\n" .
"</tr><tr>\n" .
"<th>${rlanguage}</th>\n" .
d556 2
a557 2
"<th>IPA Pronunciation</th>\n" .
"<th>Spelling Convention</th>\n" .
d559 3
a561 1
"</tr>\n";
d563 1
a563 1
$search_token = "";
d565 1
a565 1
foreach($results as $result) {
d567 1
a567 1
for ($i = 0; $i < count($result); $i++) {
d569 5
a573 1
if ($i == 0) {
d575 1
a575 1
$search_token = $web->tohtml($result[$i]);
d577 1
a577 1
$total_searched_words++;
d579 6
a584 5
print
"<tr>\n" .
"<td colspan=\"6\" align=\"left\">\n" .
"<hr><b>[$search_token]</b>\n" .
"</td></tr>\n";
d586 2
a587 2
continue;
}
d589 1
a589 6
$pos = $result[$i]->part_of_speech;
$language_value = $web->tohtml($language_value);
$p = $web->tohtml($result[$i]->pronunciation);
$pipa = $web->tohtml($result[$i]->pronunciation_ipa);
$spl = $web->tohtml($result[$i]->spelling_flag);
$comments = $web->tohtml($result[$i]->comments);
d591 2
a592 1
foreach($parts_of_speech as $part_of_speech) {
d594 2
a595 1
if ($pos == $part_of_speech->pkey) {
d597 8
a604 15
$pos = $part_of_speech->part_of_speech;
break;
}
}
$language_value = "";
$alt_language_value = "";
if ($language == "English") {
$language_value = $result[$i]->indonesian;
$alt_language_value = $result[$i]->english;
d606 3
a608 1
} else {
d610 2
a611 1
$language_value = $result[$i]->english;
d613 1
a613 2
$alt_language_value = $result[$i]->indonesian;
}
d615 1
a615 1
if ($spl == 0) {
d617 1
a617 1
$spl = "Modern<br>(after 1972)";
d619 1
a619 1
} else {
d621 1
a621 2
$spl = "Old<br>(before 1972)";
}
d623 1
a623 1
if ($comments == "") {
d625 1
a625 11
$comments = "N/A";
}
if ($search_token == $alt_language_value) {
$exact_matches++;
} else {
$maybe_matches++;
}
d629 6
a634 6
"<td>${language_value} </td>\n" .
"<td>${pos} </td>\n" .
"<td>${p} </td>\n" .
"<td>${pipa} </td>\n" .
"<td>${spl} </td>\n" .
"<td>${comments} </td>\n" .
d636 3
a638 1
}
d641 1
a641 5
print "</table><hr>";
$errstr =
$indonesia->log_search(
$visitor, $language_flag, 2, $exact_matches, $maybe_matches);
@
1.4
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 22, 2003
a279 1
//
d312 1
a312 1
if ($results["hits"] == 0) {
d325 1
a325 1
"<hr><b>Found $results[hits] exact " .
a331 1
"<hr>" .
a333 2
$i = 0;
d336 1
a336 1
for($i = 0; $i < $results["hits"]; $i++) {
d382 5
d389 1
a389 1
print "</table><hr>\n";
a393 1
//
a400 4
$exact_matches = 0;
$maybe_matches = 0;
a403 2
$rlanguage = "Indonesian";
a410 2
$rlanguage = "English";
d415 2
a416 1
$indonesia->search_fuzzy($results, $stoken, $language, "");
a424 1
$matches = count($results);
d426 1
a426 1
if ($matches == 0) {
d430 5
a434 18
"Found ${matches} exact and/or close matches for " .
"${language} word(s): " .
"${stoken}</b><hr><br>\n";
$errstr =
$indonesia->log_search(
$visitor, $language_flag, 1, $exact_matches, $maybe_matches);
return;
}
$parts_of_speech = array();
$errstr = $indonesia->get_parts_of_speech($parts_of_speech);
if ($errstr != "") {
print "<br><hr><b>${errstr}</b><hr><br>\n";
d440 5
a444 2
"<hr><b>Found ${matches} exact and/or close " .
"matches for ${language} word(s): ${stoken}</b><hr><br>\n";
a446 1
"<hr>" .
d449 1
a449 1
foreach($results as $result) {
d451 1
a451 1
$language_value = "";
d453 1
a453 1
$alt_language_value = "";
d455 1
a455 21
if ($language == "English") {
$language_value = $result->indonesian;
$alt_language_value = $result->english;
} else {
$language_value = $result->english;
$alt_language_value = $result->indonesian;
}
if ($stoken == $alt_language_value) {
$exact_matches++;
} else {
$maybe_matches++;
}
d461 2
a462 2
"<th>${rlanguage}</th>\n" .
"<th>${language}</th>\n" .
d465 2
a466 2
"<th>IPA Pronunciation</th>\n" .
"<th>Spelling Convention</th>\n" .
a470 2
$i++;
d473 2
a474 7
$language_value = $web->tohtml($language_value);
$alt_language_value = $web->tohtml($alt_language_value);
$pos = $web->tohtml($result->part_of_speech);
$p = $web->tohtml($result->pronunciation);
$pipa = $web->tohtml($result->pronunciation_ipa);
$spl = $web->tohtml($result->spelling_flag);
$comments = $web->tohtml($result->comments);
d476 2
a477 1
if ($spl == 0) {
d479 2
a480 1
$spl = "Modern<br>(after 1972)";
d482 2
a483 1
} else {
d485 2
a486 2
$spl = "Old<br>(before 1972)";
}
d488 2
a489 16
if ($comments == "") {
$comments = "N/A";
}
foreach($parts_of_speech as $part_of_speech) {
if ($pos == $part_of_speech->pkey) {
$pos = $part_of_speech->part_of_speech;
$pos = $web->tohtml($pos);
break;
}
}
d491 3
d496 7
a502 7
"<td>${language_value} </td>\n" .
"<td>${alt_language_value} </td>\n" .
"<td>${pos} </td>\n" .
"<td>${p} </td>\n" .
"<td>${pipa} </td>\n" .
"<td>${spl} </td>\n" .
"<td>${comments} </td>\n" .
d504 5
d511 1
a511 5
print "</table><hr>\n";
$errstr =
$indonesia->log_search(
$visitor, $language_flag, 1, $exact_matches, $maybe_matches);
a515 1
//
@
1.3
log
@*** empty log message ***
@
text
@d12 1
a12 1
// Modified: August 19, 2003
a290 2
$rlanguage = "Indonesian";
a297 2
$rlanguage = "English";
d302 2
a303 1
$indonesia->search_exact($results, $stoken, $language, "");
a311 1
$matches = count($results);
d313 1
a313 1
if ($matches == 0) {
d317 4
a320 6
"Found ${matches} matches for ${language} word(s): " .
"${stoken}</b><hr><br>\n";
$errstr =
$indonesia->log_search(
$visitor, $language_flag, 0, $matches, 0);
a324 9
$parts_of_speech = array();
$errstr = $indonesia->get_parts_of_speech($parts_of_speech);
if ($errstr != "") {
return("<hr><b>${errstr}</b><hr><br>\n");
}
d326 5
a330 2
"<hr><b>Found ${matches} exact " .
"matches for ${language} word(s): ${stoken}</b><hr><br>\n";
d338 1
a338 11
foreach($results as $result) {
$language_value = "";
$alt_language_value = "";
if ($language == "English") {
$language_value = $result->indonesian;
$alt_language_value = $result->english;
d340 1
a340 1
} else {
d342 1
a342 4
$language_value = $result->english;
$alt_language_value = $result->indonesian;
}
d348 1
a348 1
"<th>${rlanguage}</th>\n" .
d351 2
a352 2
"<th>IPA Pronunciation</th>\n" .
"<th>Spelling Convention</th>\n" .
a356 2
$i++;
d359 2
a360 6
$language_value = $web->tohtml($language_value);
$pos = $web->tohtml($result->part_of_speech);
$p = $web->tohtml($result->pronunciation);
$pipa = $web->tohtml($result->pronunciation_ipa);
$spl = $web->tohtml($result->spelling_flag);
$comments = $web->tohtml($result->comments);
d362 2
a363 1
if ($spl == 0) {
d365 2
a366 1
$spl = "Modern<br>(after 1972)";
d368 2
a369 1
} else {
d371 2
a372 7
$spl = "Old<br>(before 1972)";
}
if ($comments == "") {
$comments = "N/A";
}
d374 2
a375 11
foreach($parts_of_speech as $part_of_speech) {
if ($pos == $part_of_speech->pkey) {
$pos = $part_of_speech->part_of_speech;
$pos = $web->tohtml($pos);
break;
}
}
d379 6
a384 6
"<td>${language_value} </td>\n" .
"<td>${pos} </td>\n" .
"<td>${p} </td>\n" .
"<td>${pipa} </td>\n" .
"<td>${spl} </td>\n" .
"<td>${comments} </td>\n" .
a388 3
$errstr =
$indonesia->log_search($visitor, $language_flag, 0, $matches, 0);
@
1.2
log
@*** empty log message ***
@
text
@a39 5
if (session_is_registered("NODUP_SEND_EMAIL")) {
session_unregister("NODUP_SEND_EMAIL");
}
@
1.1
log
@Initial revision
@
text
@d5 33
a37 1
@
1.1.1.1
log
@Bahasa Indonesia Dictionary
@
text
@@