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 >
Text File  |  2003-10-26  |  35KB  |  1,893 lines

  1. head    1.17;
  2. access;
  3. symbols
  4.     Initial:1.1.1.1 bule:1.1.1;
  5. locks; strict;
  6. comment    @# @;
  7.  
  8.  
  9. 1.17
  10. date    2003.10.26.01.53.10;    author bule;    state Exp;
  11. branches;
  12. next    1.16;
  13.  
  14. 1.16
  15. date    2003.10.20.00.21.46;    author bule;    state Exp;
  16. branches;
  17. next    1.15;
  18.  
  19. 1.15
  20. date    2003.10.18.00.33.42;    author bule;    state Exp;
  21. branches;
  22. next    1.14;
  23.  
  24. 1.14
  25. date    2003.10.17.00.39.36;    author bule;    state Exp;
  26. branches;
  27. next    1.13;
  28.  
  29. 1.13
  30. date    2003.10.06.00.39.27;    author bule;    state Exp;
  31. branches;
  32. next    1.12;
  33.  
  34. 1.12
  35. date    2003.10.01.06.51.30;    author bule;    state Exp;
  36. branches;
  37. next    1.11;
  38.  
  39. 1.11
  40. date    2003.09.11.05.28.22;    author bule;    state Exp;
  41. branches;
  42. next    1.10;
  43.  
  44. 1.10
  45. date    2003.09.05.06.42.30;    author bule;    state Exp;
  46. branches;
  47. next    1.9;
  48.  
  49. 1.9
  50. date    2003.09.04.07.27.00;    author bule;    state Exp;
  51. branches;
  52. next    1.8;
  53.  
  54. 1.8
  55. date    2003.08.28.20.04.48;    author bule;    state Exp;
  56. branches;
  57. next    1.7;
  58.  
  59. 1.7
  60. date    2003.08.27.07.17.44;    author bule;    state Exp;
  61. branches;
  62. next    1.6;
  63.  
  64. 1.6
  65. date    2003.08.26.07.22.38;    author bule;    state Exp;
  66. branches;
  67. next    1.5;
  68.  
  69. 1.5
  70. date    2003.08.23.23.27.15;    author bule;    state Exp;
  71. branches;
  72. next    1.4;
  73.  
  74. 1.4
  75. date    2003.08.23.16.07.20;    author bule;    state Exp;
  76. branches;
  77. next    1.3;
  78.  
  79. 1.3
  80. date    2003.08.21.06.18.07;    author bule;    state Exp;
  81. branches;
  82. next    1.2;
  83.  
  84. 1.2
  85. date    2003.08.19.19.24.21;    author bule;    state Exp;
  86. branches;
  87. next    1.1;
  88.  
  89. 1.1
  90. date    2003.08.12.19.18.23;    author bule;    state Exp;
  91. branches
  92.     1.1.1.1;
  93. next    ;
  94.  
  95. 1.1.1.1
  96. date    2003.08.12.19.18.23;    author bule;    state Exp;
  97. branches;
  98. next    ;
  99.  
  100.  
  101. desc
  102. @@
  103.  
  104.  
  105. 1.17
  106. log
  107. @*** empty log message ***
  108. @
  109. text
  110. @<?
  111. session_start();
  112. require_once("../php/Indonesia.php");
  113. require_once("../php/Web.php");
  114. //////////////////////////////////////////////////////////////////////////////
  115. //////////////////////////////////////////////////////////////////////////////
  116. // Project Name: Bahasa Indonesia Dictionary
  117. // Directory:    bahasa/web
  118. // File Name:    search.php
  119. // Author(s):    John L. Whiteman
  120. // Created:      June 23, 2003  
  121. // Modified:     October 20, 2003
  122. // Description:  The purpose of this unrestricted access PHP web 
  123. //               client page is allow a client to search for words
  124. //               in the dictionary. 
  125. // 
  126. // Copyright (c) 2003 John L. Whiteman
  127. //
  128. // Permission is herby granted, free of charge, to any person obtaining a 
  129. // copy of this software, data, and associated documentation files 
  130. // (the "Software"), to deal in the Software without restriction, 
  131. // including without limitation the rights to use, copy, modify, merge, 
  132. // publish, distribute, sublicense, and/or sell copies of Software, and to
  133. // permit persons to whom the Software is furnished to do so, subject to 
  134. // the following conditions:
  135. //
  136. // The above copyright notice and this permission notice shall be 
  137. // included in all copies or substantial portions of the Software.
  138. //
  139. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  140. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
  141. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  142. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
  143. // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
  144. // TORT OR OTHERWISE, ARISING IN THE SOFTWARE.  
  145. //////////////////////////////////////////////////////////////////////////////
  146. //////////////////////////////////////////////////////////////////////////////
  147. $web = new Web();
  148.  
  149. if ($_SESSION['NODUP_REQUEST_ENTRY']) {
  150.  
  151.     unset($_SESSION['NODUP_REQUEST_ENTRY']);
  152. }
  153.  
  154. $indonesia = new Indonesia();
  155.  
  156. $status = $indonesia->get_dictionary_status(); 
  157.  
  158. if (
  159. ($status["status"] == 1) || 
  160. ($status["status"] == 2) || 
  161. ($status["status"] == 3)) {
  162.  
  163.     $web->redirect("offline.php");
  164.  
  165.     exit;
  166. }
  167.  
  168. ?>
  169. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  170.  "http://www.w3.org/TR/html4/strict.dtd">
  171. <html>
  172. <head>
  173. <title>Bahasa Indonesia Dictionary: Search</title>
  174.  
  175. <link href="bahasa.css" rel="stylesheet" type="text/css">
  176.  
  177. <script type="text/javascript" src="bahasa.js"></script>
  178.  
  179. <script language="Javascript" type="text/javascript"> 
  180. <!--
  181. //////////////////////////////////////////////////////////////////////////////
  182. function verify() {
  183.  
  184.     var stoken = document.search.stoken.value;
  185.  
  186.     stoken = trim(stoken);
  187.  
  188.     if (is_white_space(stoken)) {
  189.  
  190.         alert("You must enter a search value.");
  191.  
  192.         document.search.stoken.focus();
  193.  
  194.         return(false);
  195.     }
  196.  
  197.     return(true);
  198. }
  199. //////////////////////////////////////////////////////////////////////////////
  200. // -->
  201. </script>
  202. </head>
  203. <body bgcolor="#fffff2">
  204. <? $web->show_logo("Search"); ?>
  205.  
  206. <a class="menu" href="reference.php">Reference</a>
  207.  | 
  208. <a class="menu" href="email.php">Send Us E-mail</a>
  209.  | 
  210. <a class="menu" href="request.php">Request a New Word</a>
  211.  | 
  212. <a class="menu" href="admin.php">Administration</a>
  213. <br><br>
  214. <?
  215. $edate = $indonesia->get_english_date();
  216. $idate = $indonesia->get_indonesian_date();
  217.  
  218. print "<b>${edate}  |  ${idate}</b>";
  219.  
  220. $id = uniqid(rand(), true);
  221.  
  222. ?>
  223. <form name="search" method="post" onSubmit='return verify()'>
  224. <table cellpadding="3" cellspacing="3" border="0">
  225. <tr>
  226. <?
  227.  
  228. $total_words = "";
  229.  
  230. $errstr = $indonesia->get_count("dictionary", $total_words);
  231.  
  232. if ($errstr != "") {
  233.  
  234.     print "<td><b>Search Entries:</b>\n";
  235.  
  236. } else {
  237.  
  238.     $total_words = number_format($total_words);
  239.  
  240.     print "<td><b>Search ${total_words} Entries:</b>\n";
  241. }
  242.  
  243. ?>
  244. </td>
  245. </tr><tr>
  246. <td>
  247. <textarea name="stoken" rows="3" cols="55" wrap="soft"></textarea>
  248. </td>
  249. </tr><tr>
  250. <td>
  251. <input type="radio" name="method" value="exact"
  252. <?
  253.  
  254. if ($_POST['method'] == "exact") {   
  255.  
  256.     print " checked";
  257. }
  258.  
  259. ?> 
  260.  
  261. ><a class="help" href="help.php?topic=searching">Exact</a> 
  262. <input type="radio" name="method" value="fuzzy"
  263.  
  264. <?
  265. if (!isset($_POST['method'])) {
  266.  
  267.     print " checked";
  268.  
  269. } else if (isset($_POST['method'])) {
  270.  
  271.     if ($_POST['method'] == "fuzzy") {   
  272.  
  273.         print " checked";
  274.     }
  275. }
  276.  
  277. ?>
  278.  
  279. ><a class="help" href="help.php?topic=searching">Fuzzy</a> 
  280. <input type="radio" name="method" value="linear"
  281.  
  282. <?
  283. if (isset($_POST['method'])) {
  284.  
  285.     if ($_POST['method'] == "linear") {   
  286.  
  287.         print " checked";
  288.     }
  289. }
  290.  
  291. ?>
  292.  
  293. ><a class="help" href="help.php?topic=searching">Multiple Words</a>
  294. </td>
  295. </tr><tr>
  296. <td></td>
  297. </tr><tr>
  298. <td align="right">
  299. <input type="submit" name="language" value="English to Indonesian"> 
  300.    
  301. <input type="submit" name="language" value="Indonesian to English">
  302. </td>
  303. </tr>
  304. </table>
  305. <input type="hidden" name="id" value="<?echo ${id};?>">
  306. </form>
  307. <script language="Javascript" type="text/javascript">
  308. <!--
  309. document.search.stoken.focus();
  310. // -->
  311. </script> 
  312.  
  313. <?
  314. if (
  315. ($_SESSION['NODUP_SEARCHES']) &&
  316. (isset($_POST['id'])) &&
  317. ($_SESSION['NODUP_SEARCHES'] == $_POST['id'])) {
  318.  
  319.         //Do nothing...prevents refresh duplication of last action
  320.  
  321. } else if (
  322. (isset($_POST['stoken'])) &&
  323. (isset($_POST['method'])) &&
  324. (isset($_POST['id'])) &&
  325. (isset($_POST['language']))) { 
  326.  
  327.     if ($_SESSION['NODUP_SEARCHES']) {
  328.  
  329.         unset($_SESSION['NODUP_SEARCHES']);
  330.     }
  331.  
  332.     $rc =
  333.     search(
  334.     $web, $indonesia, 
  335.     $_POST['stoken'], $_POST['method'], $_POST['language']);
  336.  
  337.     if ($rc == 0) {
  338.  
  339.         $_SESSION['NODUP_SEARCHES'] = $_POST['id'];
  340.     }
  341. }
  342.  
  343. $web->show_footer();
  344. ?>
  345. </body>
  346. </html>
  347.  
  348. <?
  349. ///////////////////////////////////////////////////////////////////////////////
  350. ///////////////////////////////////////////////////////////////////////////////
  351. function search($web, $indonesia, $stoken, $method, $language) {
  352.  
  353.     $stoken = trim($stoken);
  354.  
  355.     if ($stoken == "") {
  356.  
  357.         print "You must enter a search value.";
  358.  
  359.         return(-1);
  360.     }
  361.  
  362.     $method = trim($method);
  363.  
  364.     if ($method == "") {
  365.  
  366.         print "You must choose a search method.";
  367.  
  368.         return(-1);
  369.     }
  370.  
  371.     $language = trim($language);
  372.  
  373.     if ($method == "exact") {
  374.  
  375.         return(
  376.         search_exact(
  377.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
  378.  
  379.     } else if ($method == "fuzzy") {
  380.  
  381.         return(
  382.         search_fuzzy(
  383.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
  384.  
  385.     } else if ($method == "linear") {
  386.  
  387.         return(
  388.         search_linear(
  389.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']));
  390.     }
  391.  
  392.     return;
  393. }
  394. ///////////////////////////////////////////////////////////////////////////////
  395. ///////////////////////////////////////////////////////////////////////////////
  396. function search_exact($web, $indonesia, $stoken, $language, $visitor) {
  397.  
  398.     $results = array();
  399.  
  400.     if ($language == "English to Indonesian") {
  401.  
  402.         $language = "English";
  403.  
  404.     } else {
  405.  
  406.         $language = "Indonesian";
  407.     }
  408.  
  409.     $errstr =
  410.     $indonesia->search_exact(
  411.     $results, $stoken, $language, $visitor, "");
  412.  
  413.     if ($errstr != "") {
  414.  
  415.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  416.  
  417.         return(-1);
  418.     }
  419.  
  420.     print 
  421.     "<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
  422.     "<tr>\n" .
  423.     "<td colspan=\"11\"><hr></td>\n" .
  424.     "</tr><tr>\n" .
  425.     "<td><b>Results:</b></td>\n" .
  426.     "<td><i>$results[total]</i></td>\n" .
  427.     "<td><b> | </b></td>\n" .
  428.     "<td><b>Duration:</b></td>\n" .
  429.     "<td><i>$results[elasped_time] (s)</i></td>\n" .
  430.     "<td><b> | </b></td>\n" .
  431.     "<td><b>Language:</b></td>\n" .
  432.     "<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
  433.     "<td><b> | </b></td>\n" .
  434.     "<td><b>Method:</b></td>\n" .
  435.     "<td><i>$results[method]</i></td>\n" .
  436.     "</tr><tr>\n" .
  437.     "<td colspan=\"11\"><hr></td>\n" .
  438.     "</tr></table>\n";    
  439.  
  440.     if ($results["total"] == 0) { 
  441.  
  442.         return(0);
  443.     }
  444.  
  445.     print 
  446.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n";
  447.  
  448.     $results["alt_language"] = $web->tohtml($results["alt_language"]);
  449.  
  450.     for($i = 0; $i < $results["total"]; $i++) {
  451.  
  452.         $result = $results["results"][$i];
  453.  
  454.         if ($i == 0) {
  455.  
  456.             print
  457.             "<tr>\n" .
  458.             "<th>$results[alt_language]</th>\n" .
  459.             "<th>Part of Speech</th>\n" .
  460.             "<th>Pronunciation</th>\n" .
  461.             "<th>Spelling</th>\n" .
  462.             "<th>Comments</th>\n" .
  463.             "</tr><tr>\n" .
  464.             "<th colspan=\"5\"><hr>\n" .
  465.             "</tr>\n";
  466.         }
  467.  
  468.         $result["target"] = 
  469.             $web->tohtml($result["target"]);
  470.  
  471.         $result["pos"] = 
  472.             $web->tohtml($result["pos"]);
  473.  
  474.         $result["pronunciation"] = 
  475.             $web->tohtml($result["pronunciation"]);
  476.  
  477.         //$result["pronunciation_ipa"] = 
  478.         //    $web->tohtml($result["pronunciation_ipa"]);
  479.  
  480.         $result["spelling"] = 
  481.             $web->tohtml($result["spelling"]);
  482.  
  483.         $result["comments"] = 
  484.             $web->tohtml($result["comments"]);
  485.         
  486.         //"<td>" . $result["pronunciation"] . " </td>\n" .
  487.  
  488.         print 
  489.         "<tr>\n" .
  490.         "<td>" . $result["target"] . " </td>\n" .
  491.         "<td align=\"center\">" . $result["pos"] . 
  492.         " </td>\n" .
  493.         "<td align=\"center\">n/a</td>\n" .
  494.         "<td align=\"center\">" . $result["spelling"] . 
  495.         " </td>\n" .
  496.         "<td>" . $result["comments"] . " </td>\n" .
  497.         "</tr>\n";
  498.  
  499.         if ($i == $results["total"] - 1) {
  500.  
  501.             print "<tr><td colspan=\"5\"><hr></td></tr>\n";
  502.         } 
  503.     }
  504.  
  505.     print "</table>\n";
  506.  
  507.     return(0);
  508. ///////////////////////////////////////////////////////////////////////////////
  509. ///////////////////////////////////////////////////////////////////////////////
  510. function search_fuzzy($web, $indonesia, $stoken, $language, $visitor) {
  511.  
  512.     $results = array();
  513.  
  514.     if ($language == "English to Indonesian") {
  515.  
  516.         $language = "English";
  517.  
  518.     } else {
  519.  
  520.         $language = "Indonesian";
  521.     }
  522.  
  523.     $errstr =
  524.     $indonesia->search_fuzzy(
  525.     $results, $stoken, $language, $visitor, "");
  526.  
  527.     if ($errstr != "") {
  528.  
  529.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  530.  
  531.         return(-1);
  532.     }
  533.  
  534.     print 
  535.     "<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
  536.     "<tr>\n" .
  537.     "<td colspan=\"11\"><hr></td>\n" .
  538.     "</tr><tr>\n" .
  539.     "<td><b>Results:</b></td>\n" .
  540.     "<td><i>$results[total]</i></td>\n" .
  541.     "<td><b> | </b></td>\n" .
  542.     "<td><b>Duration:</b></td>\n" .
  543.     "<td><i>$results[elasped_time] (s)</i></td>\n" .
  544.     "<td><b> | </b></td>\n" .
  545.     "<td><b>Language:</b></td>\n" .
  546.     "<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
  547.     "<td><b> | </b></td>\n" .
  548.     "<td><b>Method:</b></td>\n" .
  549.     "<td><i>$results[method]</i></td>\n" .
  550.     "</tr><tr>\n" .
  551.     "<td colspan=\"11\"><hr></td>\n" .
  552.     "</tr></table>\n";    
  553.  
  554.     if ($results["total"] == 0) { 
  555.  
  556.         return(0);
  557.     }
  558.  
  559.     print 
  560.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n";
  561.  
  562.     $results["language"] = $web->tohtml($results["language"]);
  563.  
  564.     $results["alt_language"] = $web->tohtml($results["alt_language"]);
  565.  
  566.     for($i = 0; $i < $results["total"]; $i++) {
  567.  
  568.         $result = $results["results"][$i];
  569.  
  570.         if ($i == 0) {
  571.  
  572.             print
  573.             "<tr>\n" .
  574.             "<th>$results[language]</th>\n" .
  575.             "<th>$results[alt_language]</th>\n" .
  576.             "<th>Part of Speech</th>\n" .
  577.             "<th>Pronunciation</th>\n" .
  578.             "<th>Spelling</th>\n" .
  579.             "<th>Comments</th>\n" .
  580.             "</tr><tr>\n" .
  581.             "<th colspan=\"6\"><hr>\n" .
  582.             "</tr>\n";
  583.         }
  584.  
  585.         $result["source"] = 
  586.             $web->tohtml($result["source"]);
  587.  
  588.         $result["target"] = 
  589.             $web->tohtml($result["target"]);
  590.  
  591.         $result["pos"] = 
  592.             $web->tohtml($result["pos"]);
  593.  
  594.         $result["pronunciation"] = 
  595.             $web->tohtml($result["pronunciation"]);
  596.  
  597.         //$result["pronunciation_ipa"] = 
  598.         //    $web->tohtml($result["pronunciation_ipa"]);
  599.  
  600.         $result["spelling"] = 
  601.             $web->tohtml($result["spelling"]);
  602.  
  603.         $result["comments"] = 
  604.             $web->tohtml($result["comments"]);
  605.  
  606.         print 
  607.         "<tr>\n" .
  608.         "<td>" . $result["source"] . " </td>\n" .
  609.         "<td>" . $result["target"] . " </td>\n" .
  610.         "<td align=\"center\">" . $result["pos"] . 
  611.         " </td>\n" .
  612.         "<td align=\"center\">n/a</td>\n" .
  613.         "<td align=\"center\">" . $result["spelling"] . 
  614.         " </td>\n" .
  615.         "<td>" . $result["comments"] . " </td>\n" .
  616.         "</tr>\n";
  617.  
  618.         if ($i == $results["total"] - 1) {
  619.  
  620.             print "<tr><td colspan=\"6\"><hr></td></tr>\n";
  621.         } 
  622.     }
  623.  
  624.     print "</table>\n";
  625.  
  626.     return(0);
  627. ///////////////////////////////////////////////////////////////////////////////
  628. ///////////////////////////////////////////////////////////////////////////////
  629. function search_linear($web, $indonesia, $stokens, $language, $visitor) {
  630.  
  631.     $results = array();
  632.  
  633.     $rlanguage = "";
  634.  
  635.     if ($language == "English to Indonesian") {
  636.  
  637.         $language = "English";
  638.  
  639.     } else {
  640.  
  641.         $language = "Indonesian";
  642.     }
  643.  
  644.     $errstr =
  645.     $indonesia->search_linear(
  646.     $results, $stokens, $language, $visitor);
  647.  
  648.     if ($errstr != "") {
  649.  
  650.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  651.  
  652.         return(-1);
  653.     }
  654.  
  655.     print 
  656.     "<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
  657.     "<tr>\n" .
  658.     "<td colspan=\"11\"><hr></td>\n" .
  659.     "</tr><tr>\n" .
  660.     "<td><b>Results:</b></td>\n" .
  661.     "<td><i>$results[total]</i></td>\n" .
  662.     "<td><b> | </b></td>\n" .
  663.     "<td><b>Duration:</b></td>\n" .
  664.     "<td><i>$results[elasped_time] (s)</i></td>\n" .
  665.     "<td><b> | </b></td>\n" .
  666.     "<td><b>Language:</b></td>\n" .
  667.     "<td><i>$results[language] -> $results[alt_language]</i></td>\n" .
  668.     "<td><b> | </b></td>\n" .
  669.     "<td><b>Method:</b></td>\n" .
  670.     "<td><i>$results[method]</i></td>\n" .
  671.     "</tr></table>\n";    
  672.  
  673.     print 
  674.     "<table cellspacing=\"1\" cellpadding=\"1\" border=\"0\">\n" .
  675.     "<tr>\n" .
  676.     "<td><b>Words:</b></td>\n" .
  677.     "<td>$results[total_search_tokens]</td>\n" .
  678.     "<td><b> | </b></td>\n" .
  679.     "<td><b>Words (unique):</b></td>\n" .
  680.     "<td>$results[total_search_tokens_unique]</td>\n" .
  681.     "<td><b> | </b></td>\n" .
  682.     "<td><b>Search Score:</b></td>\n" .
  683.     "<td>$results[search_score_unique]</td>\n" .
  684.     "<td><b> | </b></td>\n" .
  685.     "<td><b>Search Score (unique):</b></td>\n" .
  686.     "<td>$results[search_score_unique]</b></td>\n" .
  687.     "</tr><tr>\n" .
  688.     "<td colspan=\"11\"><hr></td>\n" .
  689.     "</tr></table>\n";    
  690.  
  691.     if ($results["total"] == 0) { 
  692.  
  693.         return(0);
  694.     }
  695.  
  696.     /*print 
  697.     "<hr><b>Found the following exact and/or close " .
  698.     "match(es) for $results[language] word(s):</b><hr>" .
  699.     "$results[search]<hr><b>\n" .
  700.     "Search Duration: " . $results["elasped_time"] .
  701.     " second(s)</b><br>\n" .
  702.     "<b>Search Score: " .
  703.     $results["search_score"] .
  704.     "<br>Search Score (Unique Matches): " .
  705.     $results["search_score_unique"] .
  706.     "<br>Search Words: " . $results["total_search_tokens"] .
  707.     "<br>Unique Search Words: " . 
  708.     $results["total_search_tokens_unique"] .
  709.     "<br>Unique Exact Matches: " .
  710.     $results["hits_unique"] .
  711.     "<br>Unique Possible Matches: " .
  712.     $results["maybes_unique"] .
  713.     "<br>Unique Misses: " .
  714.     $results["misses_unique"] .
  715.     "</b><hr>\n"; 
  716. */
  717.  
  718.     print
  719.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
  720.     "<tr>\n" .
  721.     "<th>$results[language] / $results[alt_language]</th>\n" .
  722.     "<th>Part of Speech</th>\n" .
  723.     "<th>Pronunciation</th>\n" .
  724.     "<th>Spelling</th>\n" .
  725.     "<th>Comments</th>\n" .
  726.     "</tr><tr>\n" .
  727.     "<th colspan=\"7\"><hr>\n" .
  728.     "</tr>\n";
  729.  
  730.     $search_strings = count($results["results"]);
  731.  
  732.     for($i = 0; $i < $search_strings; $i++) {
  733.  
  734.         $token = $web->tohtml($results["results"][$i]["search"]); 
  735.  
  736.         print 
  737.         "<tr>\n" .
  738.         "<td colspan=\"5\" align=\"left\">\n" .
  739.         "<b>( ${token} )</b></td></tr>\n" .
  740.         "<tr>\n";
  741.  
  742.         $matches = count($results["results"][$i]["words"]);
  743.  
  744.         if ($matches == 0) {
  745.  
  746.             print 
  747.             "<tr>\n" .
  748.             "<td colspan=\"5\" align=\"left\">\n" .
  749.             "<i>No matches found for this word!</i>\n" .
  750.             "</td></tr><tr>\n" .
  751.             "<td colspan=\"5\"><hr></td></tr>\n";
  752.  
  753.             continue;
  754.         }
  755.  
  756.         for($j = 0; $j < $matches; $j++) {
  757.  
  758.             $source = 
  759.             $results["results"][$i]["words"][$j]["source"];
  760.  
  761.             $target = 
  762.             $results["results"][$i]["words"][$j]["target"];
  763.  
  764.             $pos =
  765.             $results["results"][$i]["words"][$j]["pos"];
  766.         
  767.             $spelling =
  768.             $results["results"][$i]["words"][$j]["spelling"];
  769.     
  770.             $pronunciation = 
  771.             $results["results"][$i]["words"][$j]["pronunciation"];
  772.  
  773.         //    $pronunciation_ipa =
  774.         //    $results["results"][$i]["words"][$j]
  775.         //    ["pronunciation_ipa"];
  776.  
  777.             $comments =
  778.             $results["results"][$i]["words"][$j]["comments"];
  779.  
  780.             $source = $web->tohtml($source);
  781.  
  782.             $target = $web->tohtml($target);
  783.  
  784.             $pos = $web->tohtml($pos);
  785.  
  786.             $spelling = $web->tohtml($spelling);
  787.  
  788.             $pronunciation = $web->tohtml($pronunciation);
  789.  
  790.             $pronunciation_ipa = $web->tohtml($pronunciation_ipa);
  791.  
  792.             $comments = $web->tohtml($comments);
  793.  
  794.             print 
  795.             "<tr>\n" .
  796.             "<td>${target} </td>\n" .
  797.             "<td align=\"center\">${pos} </td>\n" .
  798.             "<td align=\"center\">n/a</td>\n" .
  799.             "<td align=\"center\">${spelling} </td>\n" .
  800.             "<td>${comments} </td>\n" .
  801.             "</tr>\n";
  802.         }
  803.  
  804.         print "<tr><td colspan=\"5\"><hr></td></tr>\n";
  805.     }
  806.  
  807.     print "</table>\n";
  808.  
  809.     return(0);
  810. }
  811. ///////////////////////////////////////////////////////////////////////////////
  812. ///////////////////////////////////////////////////////////////////////////////
  813. ?>
  814. @
  815.  
  816.  
  817. 1.16
  818. log
  819. @*** empty log message ***
  820. @
  821. text
  822. @d12 1
  823. a12 1
  824. // Modified:     October 17, 2003
  825. d94 1
  826. a94 1
  827. <body>
  828. d97 1
  829. a97 1
  830. <a href="reference.php">Reference</a>
  831. d99 1
  832. a99 1
  833. <a href="email.php">Send Us E-mail</a>
  834. d101 1
  835. a101 1
  836. <a href="request.php">Request a New Word</a>
  837. d103 1
  838. a103 1
  839. <a href="admin.php">Administration</a>
  840. d152 1
  841. a152 1
  842. ><b>Exact</b> 
  843. d170 1
  844. a170 1
  845. ><b>Fuzzy</b> 
  846. d184 1
  847. a184 1
  848. ><b>Multiple Words</b>
  849. @
  850.  
  851.  
  852. 1.15
  853. log
  854. @*** empty log message ***
  855. @
  856. text
  857. @d12 1
  858. a12 1
  859. // Modified:     October 16, 2003
  860. d60 2
  861. d65 2
  862. @
  863.  
  864.  
  865. 1.14
  866. log
  867. @*** empty log message ***
  868. @
  869. text
  870. @d12 1
  871. a12 1
  872. // Modified:     October 15, 2003
  873. d64 2
  874. d67 2
  875. a68 26
  876.  
  877. function is_white_space(stoken) {
  878.  
  879.     if (stoken == null) return(true);
  880.  
  881.     if (stoken == '') return(true);
  882.  
  883.     if (stoken == "") return(true);
  884.  
  885.     return(false);
  886. }
  887.  
  888. function trim(stoken) {
  889.  
  890.     if (is_white_space(stoken)) {
  891.  
  892.         return(stoken);
  893.     }
  894.  
  895.     stoken = stoken.replace(/^\s*/, "");
  896.  
  897.     stoken = stoken.replace(/\s*$/, "");
  898.  
  899.     return(stoken);
  900. }
  901.  
  902. d86 2
  903. d195 1
  904. d197 1
  905. @
  906.  
  907.  
  908. 1.13
  909. log
  910. @*** empty log message ***
  911. @
  912. text
  913. @d12 1
  914. a12 1
  915. // Modified:     October 05, 2003
  916. d128 1
  917. d133 18
  918. a150 1
  919. <td><b>Enter Search Word(s):</b>
  920. d247 2
  921. @
  922.  
  923.  
  924. 1.12
  925. log
  926. @*** empty log message ***
  927. @
  928. text
  929. @d12 1
  930. a12 1
  931. // Modified:     September 30, 2003
  932. d111 1
  933. a111 1
  934. <h2>Bahasa Indonesia Dictionary: Search</h2>
  935. d132 1
  936. a132 1
  937. <td colspan="2"><b>Enter Search Word(s):</b>
  938. d135 1
  939. a135 1
  940. <td colspan="2">
  941. d145 2
  942. a146 1
  943.     print " checked>\n";
  944. d148 1
  945. a148 1
  946. } else {
  947. d150 1
  948. a150 9
  949.     print ">\n";
  950. }
  951. ?> 
  952. </td>
  953. <td>
  954. <b>Search dictionary for exact matches only (single word or phrase)</b>
  955. </td>
  956. </tr><tr>
  957. <td>
  958. d152 1
  959. d156 1
  960. a156 1
  961.     print " checked>\n";
  962. d162 1
  963. a162 5
  964.         print " checked>\n";
  965.  
  966.     } else {
  967.  
  968.         print ">\n";
  969. d165 1
  970. d167 2
  971. a168 6
  972. </td>
  973. <td>
  974. <b>Search dictionary for exact and/or close matches (single word or phrase)</b>
  975. </td>
  976. </tr><tr>
  977. <td>
  978. d170 1
  979. d176 1
  980. a176 5
  981.         print " checked>\n";
  982.  
  983.     } else {
  984.  
  985.         print ">\n";
  986. d179 1
  987. d181 2
  988. a182 5
  989. </td>
  990. <td>
  991. <b>
  992. Search dictionary for exact and/or close matches (multiple words or phrases)<br>
  993. </b>
  994. d185 1
  995. a185 1
  996. <td colspan="2"></td>
  997. d187 1
  998. a187 1
  999. <td align="right" colspan="2">
  1000. a234 1
  1001. //
  1002. d305 19
  1003. a326 7
  1004.         print 
  1005.         "<hr><b>\n" .
  1006.         "Found 0 matches for $results[language] word(s): " .
  1007.         "$results[search]</b><br><b>\n" .
  1008.         "Search Duration: " . $results["elasped_time"] .
  1009.         " second(s)</b><br><hr>\n"; 
  1010.  
  1011. a330 7
  1012.     "<hr><b>Found $results[total] exact " .
  1013.     "match(es) for $results[language] word(s):</b><hr>" .
  1014.     "$results[search]<hr><b>\n" .
  1015.     "Search Duration: " . $results["elasped_time"] .
  1016.     " second(s)</b><br><hr>\n"; 
  1017.  
  1018.     print 
  1019. d370 2
  1020. d376 5
  1021. a380 3
  1022.         "<td>" . $result["pos"] . " </td>\n" .
  1023.         "<td>" . $result["pronunciation"] . " </td>\n" .
  1024.         "<td>" . $result["spelling"] . " </td>\n" .
  1025. d386 1
  1026. a386 1
  1027.             print "<tr><td colspan=\"6\"><hr></td></tr>\n";
  1028. d420 20
  1029. a441 8
  1030.         print 
  1031.         "<hr><b>\n" .
  1032.         "Found 0 exact and/or close matches for " .
  1033.         "$results[language] word(s): " .
  1034.         "$results[search]</b><br><b>\n" .
  1035.         "Search Duration: " . $results["elasped_time"] .
  1036.         " second(s)</b><br><hr>\n"; 
  1037.  
  1038. a445 7
  1039.     "<hr><b>Found $results[total] exact and/or close " .
  1040.     "match(es) for $results[language] word(s):</b><hr>" .
  1041.     "$results[search]<hr><b>\n" .
  1042.     "Search Duration: " . $results["elasped_time"] .
  1043.     " second(s)</b><br><hr>\n"; 
  1044.  
  1045.     print 
  1046. d496 5
  1047. a500 3
  1048.         "<td>" . $result["pos"] . " </td>\n" .
  1049.         "<td>" . $result["pronunciation"] . " </td>\n" .
  1050.         "<td>" . $result["spelling"] . " </td>\n" .
  1051. d542 36
  1052. a579 8
  1053.         print 
  1054.         "<hr><b>\n" .
  1055.         "Found 0 exact and/or close matches for " .
  1056.         "$results[language] word(s): " .
  1057.         "$results[search]</b><br><b>\n" .
  1058.         "Search Duration: " . $results["elasped_time"] .
  1059.         " second(s)</b><br><hr>\n"; 
  1060.  
  1061. d583 1
  1062. a583 1
  1063.     print 
  1064. d603 1
  1065. d684 3
  1066. a686 3
  1067.             "<td>${pos} </td>\n" .
  1068.             "<td>${pronunciation} </td>\n" .
  1069.             "<td>${spelling} </td>\n" .
  1070. @
  1071.  
  1072.  
  1073. 1.11
  1074. log
  1075. @*** empty log message ***
  1076. @
  1077. text
  1078. @d12 1
  1079. a12 1
  1080. // Modified:     September 08, 2003
  1081. d40 1
  1082. a40 1
  1083. if (session_is_registered("NODUP_REQUEST_ENTRY")) {
  1084. d42 1
  1085. a42 1
  1086.     session_unregister("NODUP_REQUEST_ENTRY");
  1087. d220 1
  1088. a220 1
  1089. (session_is_registered("NODUP_SEARCHES")) &&
  1090. d232 1
  1091. a232 1
  1092.     if (session_is_registered("NODUP_SEARCHES")) {
  1093. d234 1
  1094. a234 1
  1095.         session_unregister("NODUP_SEARCHES");
  1096. d244 1
  1097. a244 3
  1098.         $NODUP_SEARCHES = $_POST['id'];
  1099.  
  1100.         session_register("NODUP_SEARCHES");
  1101. @
  1102.  
  1103.  
  1104. 1.10
  1105. log
  1106. @*** empty log message ***
  1107. @
  1108. text
  1109. @d12 1
  1110. a12 1
  1111. // Modified:     September 04, 2003
  1112. d110 1
  1113. a110 1
  1114. <body bgcolor="#CCCC99">
  1115. d117 1
  1116. a117 1
  1117. <a href="request.php">Request a New Entry</a>
  1118. d178 1
  1119. a178 1
  1120. <b>Search dictionary for exact and/or close matches (single word or phrases)</b>
  1121. @
  1122.  
  1123.  
  1124. 1.9
  1125. log
  1126. @*** empty log message ***
  1127. @
  1128. text
  1129. @d12 1
  1130. a12 1
  1131. // Modified:     September 03, 2003
  1132. d110 1
  1133. a110 1
  1134. <body>
  1135. d127 1
  1136. d132 1
  1137. a132 1
  1138. <td colspan="2">Enter Search Word(s):
  1139. d136 1
  1140. a136 1
  1141. <textarea name="stoken" rows="5" cols="55" wrap="soft"></textarea>
  1142. d154 1
  1143. a154 1
  1144. Search dictionary for exact matches only
  1145. d178 1
  1146. a178 1
  1147. Search dictionary for exact and/or close matches 
  1148. d198 3
  1149. a200 2
  1150. Search dictionary for multiples words or sentences sequentially <br>
  1151. displaying matches as they are encountered
  1152. d212 1
  1153. d219 6
  1154. d226 1
  1155. a226 1
  1156. if (
  1157. d229 1
  1158. d232 1
  1159. a232 1
  1160.     $TOKEN = $_POST['stoken']; 
  1161. d234 2
  1162. a235 3
  1163.     $METHOD = $_POST['method'];
  1164.  
  1165.     $LANGUAGE = $_POST['language'];
  1166. d237 1
  1167. d241 7
  1168. d265 1
  1169. a265 1
  1170.         return;
  1171. d274 1
  1172. a274 1
  1173.         return;
  1174. d281 1
  1175. d283 1
  1176. a283 1
  1177.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
  1178. d287 1
  1179. d289 1
  1180. a289 1
  1181.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
  1182. d293 1
  1183. d295 1
  1184. a295 1
  1185.         $web, $indonesia, $stoken, $language, $_SERVER['REMOTE_ADDR']);
  1186. d323 1
  1187. a323 1
  1188.         return;
  1189. d336 1
  1190. a336 1
  1191.         return;
  1192. d404 1
  1193. a404 1
  1194.     return;
  1195. d429 1
  1196. a429 1
  1197.         return;
  1198. d442 1
  1199. a442 1
  1200.         return;
  1201. d517 1
  1202. a517 1
  1203.     return;
  1204. d544 1
  1205. a544 1
  1206.         return;
  1207. d557 1
  1208. a557 1
  1209.         return;
  1210. d672 1
  1211. a672 1
  1212.     return;
  1213. @
  1214.  
  1215.  
  1216. 1.8
  1217. log
  1218. @*** empty log message ***
  1219. @
  1220. text
  1221. @d12 1
  1222. a12 1
  1223. // Modified:     August 28, 2003
  1224. a341 1
  1225.             "<th>International</th>\n" .
  1226. d345 1
  1227. a345 1
  1228.             "<th colspan=\"6\"><hr>\n" .
  1229. d358 2
  1230. a359 2
  1231.         $result["pronunciation_ipa"] = 
  1232.             $web->tohtml($result["pronunciation_ipa"]);
  1233. a371 1
  1234.         "<td>" . $result["pronunciation_ipa"] . " </td>\n" .
  1235. d378 1
  1236. a378 1
  1237.             print "<tr><td colspan=\"7\"><hr></td></tr>\n";
  1238. a450 1
  1239.             "<th>International</th>\n" .
  1240. d454 1
  1241. a454 1
  1242.             "<th colspan=\"7\"><hr>\n" .
  1243. d470 2
  1244. a471 2
  1245.         $result["pronunciation_ipa"] = 
  1246.             $web->tohtml($result["pronunciation_ipa"]);
  1247. a484 1
  1248.         "<td>" . $result["pronunciation_ipa"] . " </td>\n" .
  1249. d491 1
  1250. a491 1
  1251.             print "<tr><td colspan=\"7\"><hr></td></tr>\n";
  1252. a566 1
  1253.     "<th>International</th>\n" .
  1254. d581 1
  1255. a581 1
  1256.         "<td colspan=\"6\" align=\"left\">\n" .
  1257. d591 1
  1258. a591 1
  1259.             "<td colspan=\"6\" align=\"left\">\n" .
  1260. d594 1
  1261. a594 1
  1262.             "<td colspan=\"6\"><hr></td></tr>\n";
  1263. d616 3
  1264. a618 3
  1265.             $pronunciation_ipa =
  1266.             $results["results"][$i]["words"][$j]
  1267.             ["pronunciation_ipa"];
  1268. d639 5
  1269. a643 6
  1270.             "<td>${target}</td>\n" .
  1271.             "<td>${pos}</td>\n" .
  1272.             "<td>${pronunciation}</td>\n" .
  1273.             "<td>${pronunciation_ipa}</td>\n" .
  1274.             "<td>${spelling}</td>\n" .
  1275.             "<td>${comments}</td>\n" .
  1276. d647 1
  1277. a647 1
  1278.         print "<tr><td colspan=\"6\"><hr></td></tr>\n";
  1279. @
  1280.  
  1281.  
  1282. 1.7
  1283. log
  1284. @*** empty log message ***
  1285. @
  1286. text
  1287. @d12 1
  1288. a12 1
  1289. // Modified:     August 26, 2003
  1290. a140 3
  1291. if (!isset($_POST['method'])) {
  1292.  
  1293.     print " checked>\n";
  1294. d142 1
  1295. a142 1
  1296. } else if ($_POST['method'] == "exact") {   
  1297. d159 5
  1298. a163 1
  1299. if (isset($_POST['method'])) {
  1300. @
  1301.  
  1302.  
  1303. 1.6
  1304. log
  1305. @*** empty log message ***
  1306. @
  1307. text
  1308. @d12 1
  1309. a12 1
  1310. // Modified:     August 25, 2003
  1311. d320 2
  1312. a321 2
  1313.     "match(es) for $results[language] word(s): " .
  1314.     "$results[search]</b><br><b>\n" .
  1315. d428 2
  1316. a429 2
  1317.     "match(es) for $results[language] word(s): " .
  1318.     "$results[search]</b><br><b>\n" .
  1319. d544 3
  1320. a546 3
  1321.     "<hr><b>Found $results[total] exact and/or close " .
  1322.     "match(es) for $results[language] word(s): " .
  1323.     "$results[search]</b><br><b>\n" .
  1324. d548 15
  1325. a562 1
  1326.     " second(s)</b><br><hr>\n"; 
  1327. @
  1328.  
  1329.  
  1330. 1.5
  1331. log
  1332. @*** empty log message ***
  1333. @
  1334. text
  1335. @d12 1
  1336. a12 1
  1337. // Modified:     August 23, 2003
  1338. a284 2
  1339.     $rlanguage = "";
  1340.  
  1341. a287 2
  1342.  
  1343.         $language_flag = 0;
  1344. a291 2
  1345.  
  1346.         $language_flag = 1;
  1347. d320 1
  1348. a320 1
  1349.     "matches for $results[language] word(s): " .
  1350. a392 2
  1351.     $rlanguage = "";
  1352.  
  1353. a395 2
  1354.  
  1355.         $language_flag = 0;
  1356. a399 2
  1357.  
  1358.         $language_flag = 1;
  1359. a412 1
  1360.  
  1361. d428 1
  1362. a428 1
  1363.     "matches for $results[language] word(s): " .
  1364. d504 1
  1365. a504 1
  1366. function search_linear($web, $indonesia, $stoken, $language, $visitor) {
  1367. a509 8
  1368.     $exact_matches = 0;
  1369.     
  1370.     $maybe_matches = 0;
  1371.  
  1372.     $misses = 0;
  1373.  
  1374.     $total_searched_words = 0;
  1375.  
  1376. a513 4
  1377.         $rlanguage = "Indonesian";
  1378.  
  1379.         $language_flag = 0;
  1380.  
  1381. a516 4
  1382.  
  1383.         $rlanguage = "English";
  1384.  
  1385.         $language_flag = 1;
  1386. d519 3
  1387. a521 2
  1388.     $errstr = 
  1389.     $indonesia->search_linear($results, $stoken, $language);
  1390. d530 1
  1391. a530 1
  1392.     $matches = count($results);
  1393. d532 7
  1394. a538 7
  1395.     if ($matches == 0) {
  1396.  
  1397.         print "<br><hr><b>Found ${matches} matches!</b><hr><br>\n";
  1398.  
  1399.         $errstr = 
  1400.         $indonesia->log_search(
  1401.         $visitor, $language_flag, 2, $exact_matches, $maybe_matches); 
  1402. d543 6
  1403. a548 10
  1404.     $parts_of_speech = array();
  1405.  
  1406.     $errstr = $indonesia->get_parts_of_speech($parts_of_speech);
  1407.  
  1408.     if ($errstr != "") {
  1409.  
  1410.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  1411.  
  1412.         return;
  1413.     }
  1414. d550 1
  1415. a550 1
  1416.     print 
  1417. d553 1
  1418. a553 3
  1419.     "<th colspan=\"6\" align=\"left\">[${language}]</th>\n" .
  1420.     "</tr><tr>\n" .
  1421.     "<th>${rlanguage}</th>\n" .
  1422. d556 2
  1423. a557 2
  1424.     "<th>IPA Pronunciation</th>\n" .
  1425.     "<th>Spelling Convention</th>\n" .
  1426. d559 3
  1427. a561 1
  1428.     "</tr>\n";    
  1429. d563 1
  1430. a563 1
  1431.     $search_token = "";
  1432. d565 1
  1433. a565 1
  1434.     foreach($results as $result) {
  1435. d567 1
  1436. a567 1
  1437.         for ($i = 0; $i < count($result); $i++) {
  1438. d569 5
  1439. a573 1
  1440.             if ($i == 0) {
  1441. d575 1
  1442. a575 1
  1443.                 $search_token = $web->tohtml($result[$i]);
  1444. d577 1
  1445. a577 1
  1446.                 $total_searched_words++;
  1447. d579 6
  1448. a584 5
  1449.                 print 
  1450.                 "<tr>\n" .
  1451.                 "<td colspan=\"6\" align=\"left\">\n" .
  1452.                 "<hr><b>[$search_token]</b>\n" .
  1453.                 "</td></tr>\n";
  1454. d586 2
  1455. a587 2
  1456.                 continue;
  1457.             }
  1458. d589 1
  1459. a589 6
  1460.             $pos = $result[$i]->part_of_speech; 
  1461.             $language_value = $web->tohtml($language_value);
  1462.             $p = $web->tohtml($result[$i]->pronunciation);
  1463.             $pipa = $web->tohtml($result[$i]->pronunciation_ipa);
  1464.             $spl = $web->tohtml($result[$i]->spelling_flag);
  1465.             $comments = $web->tohtml($result[$i]->comments);
  1466. d591 2
  1467. a592 1
  1468.             foreach($parts_of_speech as $part_of_speech) {
  1469. d594 2
  1470. a595 1
  1471.                 if ($pos == $part_of_speech->pkey) {
  1472. d597 8
  1473. a604 15
  1474.                     $pos = $part_of_speech->part_of_speech;
  1475.  
  1476.                     break;
  1477.                 }
  1478.             }
  1479.  
  1480.             $language_value = "";
  1481.  
  1482.             $alt_language_value = "";
  1483.  
  1484.             if ($language == "English") {
  1485.  
  1486.                 $language_value = $result[$i]->indonesian; 
  1487.  
  1488.                 $alt_language_value = $result[$i]->english; 
  1489. d606 3
  1490. a608 1
  1491.             } else {
  1492. d610 2
  1493. a611 1
  1494.                 $language_value = $result[$i]->english; 
  1495. d613 1
  1496. a613 2
  1497.                 $alt_language_value = $result[$i]->indonesian; 
  1498.             }
  1499. d615 1
  1500. a615 1
  1501.             if ($spl == 0) {
  1502. d617 1
  1503. a617 1
  1504.                 $spl = "Modern<br>(after 1972)";
  1505. d619 1
  1506. a619 1
  1507.             } else {
  1508. d621 1
  1509. a621 2
  1510.                 $spl = "Old<br>(before 1972)";
  1511.             }
  1512. d623 1
  1513. a623 1
  1514.             if ($comments == "") {
  1515. d625 1
  1516. a625 11
  1517.                 $comments = "N/A";
  1518.             }
  1519.  
  1520.             if ($search_token == $alt_language_value) {
  1521.  
  1522.                 $exact_matches++;
  1523.  
  1524.             } else {
  1525.  
  1526.                 $maybe_matches++;
  1527.             }
  1528. d629 6
  1529. a634 6
  1530.             "<td>${language_value} </td>\n" .
  1531.             "<td>${pos} </td>\n" .
  1532.             "<td>${p} </td>\n" .
  1533.             "<td>${pipa} </td>\n" .
  1534.             "<td>${spl} </td>\n" .
  1535.             "<td>${comments} </td>\n" .
  1536. d636 3
  1537. a638 1
  1538.         }    
  1539. d641 1
  1540. a641 5
  1541.     print "</table><hr>";
  1542.  
  1543.     $errstr = 
  1544.     $indonesia->log_search(
  1545.     $visitor, $language_flag, 2, $exact_matches, $maybe_matches); 
  1546. @
  1547.  
  1548.  
  1549. 1.4
  1550. log
  1551. @*** empty log message ***
  1552. @
  1553. text
  1554. @d12 1
  1555. a12 1
  1556. // Modified:     August 22, 2003
  1557. a279 1
  1558. //
  1559. d312 1
  1560. a312 1
  1561.     if ($results["hits"] == 0) { 
  1562. d325 1
  1563. a325 1
  1564.     "<hr><b>Found $results[hits] exact " .
  1565. a331 1
  1566.     "<hr>" .
  1567. a333 2
  1568.     $i = 0;
  1569.  
  1570. d336 1
  1571. a336 1
  1572.     for($i = 0; $i < $results["hits"]; $i++) {
  1573. d382 5
  1574. d389 1
  1575. a389 1
  1576.     print "</table><hr>\n";
  1577. a393 1
  1578. //
  1579. a400 4
  1580.     $exact_matches = 0;
  1581.  
  1582.     $maybe_matches = 0;
  1583.  
  1584. a403 2
  1585.  
  1586.         $rlanguage = "Indonesian";
  1587. a410 2
  1588.         $rlanguage = "English";
  1589.  
  1590. d415 2
  1591. a416 1
  1592.     $indonesia->search_fuzzy($results, $stoken, $language, "");
  1593. a424 1
  1594.     $matches = count($results);
  1595. d426 1
  1596. a426 1
  1597.     if ($matches == 0) {
  1598. d430 5
  1599. a434 18
  1600.         "Found ${matches} exact and/or close matches for " .
  1601.         "${language} word(s): " .
  1602.         "${stoken}</b><hr><br>\n"; 
  1603.  
  1604.         $errstr = 
  1605.         $indonesia->log_search(
  1606.         $visitor, $language_flag, 1, $exact_matches, $maybe_matches); 
  1607.  
  1608.         return;
  1609.     }
  1610.  
  1611.     $parts_of_speech = array();
  1612.  
  1613.     $errstr = $indonesia->get_parts_of_speech($parts_of_speech);
  1614.  
  1615.     if ($errstr != "") {
  1616.  
  1617.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  1618. d440 5
  1619. a444 2
  1620.     "<hr><b>Found ${matches} exact and/or close " .
  1621.     "matches for ${language} word(s): ${stoken}</b><hr><br>\n"; 
  1622. a446 1
  1623.     "<hr>" .
  1624. d449 1
  1625. a449 1
  1626.     foreach($results as $result) {
  1627. d451 1
  1628. a451 1
  1629.         $language_value = "";
  1630. d453 1
  1631. a453 1
  1632.         $alt_language_value = "";
  1633. d455 1
  1634. a455 21
  1635.         if ($language == "English") {
  1636.  
  1637.             $language_value = $result->indonesian; 
  1638.  
  1639.             $alt_language_value = $result->english; 
  1640.  
  1641.         } else {
  1642.  
  1643.             $language_value = $result->english; 
  1644.  
  1645.             $alt_language_value = $result->indonesian; 
  1646.         }
  1647.  
  1648.         if ($stoken == $alt_language_value) {
  1649.  
  1650.             $exact_matches++;
  1651.  
  1652.         } else {
  1653.  
  1654.             $maybe_matches++;
  1655.         }
  1656. d461 2
  1657. a462 2
  1658.             "<th>${rlanguage}</th>\n" .
  1659.             "<th>${language}</th>\n" .
  1660. d465 2
  1661. a466 2
  1662.             "<th>IPA Pronunciation</th>\n" .
  1663.             "<th>Spelling Convention</th>\n" .
  1664. a470 2
  1665.  
  1666.             $i++;
  1667. d473 2
  1668. a474 7
  1669.         $language_value = $web->tohtml($language_value);
  1670.         $alt_language_value = $web->tohtml($alt_language_value);
  1671.         $pos = $web->tohtml($result->part_of_speech);
  1672.         $p = $web->tohtml($result->pronunciation);
  1673.         $pipa = $web->tohtml($result->pronunciation_ipa);
  1674.         $spl = $web->tohtml($result->spelling_flag);
  1675.         $comments = $web->tohtml($result->comments);
  1676. d476 2
  1677. a477 1
  1678.         if ($spl == 0) {
  1679. d479 2
  1680. a480 1
  1681.             $spl = "Modern<br>(after 1972)";
  1682. d482 2
  1683. a483 1
  1684.         } else {
  1685. d485 2
  1686. a486 2
  1687.             $spl = "Old<br>(before 1972)";
  1688.         }
  1689. d488 2
  1690. a489 16
  1691.         if ($comments == "") {
  1692.  
  1693.             $comments = "N/A";
  1694.         }
  1695.  
  1696.         foreach($parts_of_speech as $part_of_speech) {
  1697.  
  1698.             if ($pos == $part_of_speech->pkey) {
  1699.  
  1700.                 $pos = $part_of_speech->part_of_speech;
  1701.  
  1702.                 $pos = $web->tohtml($pos);
  1703.  
  1704.                 break;
  1705.             }
  1706.         }
  1707. d491 3
  1708. d496 7
  1709. a502 7
  1710.         "<td>${language_value} </td>\n" .
  1711.         "<td>${alt_language_value} </td>\n" .
  1712.         "<td>${pos} </td>\n" .
  1713.         "<td>${p} </td>\n" .
  1714.         "<td>${pipa} </td>\n" .
  1715.         "<td>${spl} </td>\n" .
  1716.         "<td>${comments} </td>\n" .
  1717. d504 5
  1718. d511 1
  1719. a511 5
  1720.     print "</table><hr>\n";
  1721.  
  1722.     $errstr = 
  1723.     $indonesia->log_search(
  1724.     $visitor, $language_flag, 1, $exact_matches, $maybe_matches); 
  1725. a515 1
  1726. //
  1727. @
  1728.  
  1729.  
  1730. 1.3
  1731. log
  1732. @*** empty log message ***
  1733. @
  1734. text
  1735. @d12 1
  1736. a12 1
  1737. // Modified:     August 19, 2003
  1738. a290 2
  1739.  
  1740.         $rlanguage = "Indonesian";
  1741. a297 2
  1742.         $rlanguage = "English";
  1743.  
  1744. d302 2
  1745. a303 1
  1746.     $indonesia->search_exact($results, $stoken, $language, "");
  1747. a311 1
  1748.     $matches = count($results);
  1749. d313 1
  1750. a313 1
  1751.     if ($matches == 0) {
  1752. d317 4
  1753. a320 6
  1754.         "Found ${matches} matches for ${language} word(s): " .
  1755.         "${stoken}</b><hr><br>\n"; 
  1756.  
  1757.         $errstr = 
  1758.         $indonesia->log_search(
  1759.         $visitor, $language_flag, 0, $matches, 0); 
  1760. a324 9
  1761.     $parts_of_speech = array();
  1762.  
  1763.     $errstr = $indonesia->get_parts_of_speech($parts_of_speech);
  1764.  
  1765.     if ($errstr != "") {
  1766.  
  1767.         return("<hr><b>${errstr}</b><hr><br>\n");
  1768.     }
  1769.  
  1770. d326 5
  1771. a330 2
  1772.     "<hr><b>Found ${matches} exact " .
  1773.     "matches for ${language} word(s): ${stoken}</b><hr><br>\n"; 
  1774. d338 1
  1775. a338 11
  1776.     foreach($results as $result) {
  1777.  
  1778.         $language_value = "";
  1779.  
  1780.         $alt_language_value = "";
  1781.  
  1782.         if ($language == "English") {
  1783.  
  1784.             $language_value = $result->indonesian; 
  1785.  
  1786.             $alt_language_value = $result->english; 
  1787. d340 1
  1788. a340 1
  1789.         } else {
  1790. d342 1
  1791. a342 4
  1792.             $language_value = $result->english; 
  1793.  
  1794.             $alt_language_value = $result->indonesian; 
  1795.         }
  1796. d348 1
  1797. a348 1
  1798.             "<th>${rlanguage}</th>\n" .
  1799. d351 2
  1800. a352 2
  1801.             "<th>IPA Pronunciation</th>\n" .
  1802.             "<th>Spelling Convention</th>\n" .
  1803. a356 2
  1804.  
  1805.             $i++;
  1806. d359 2
  1807. a360 6
  1808.         $language_value = $web->tohtml($language_value);
  1809.         $pos = $web->tohtml($result->part_of_speech);
  1810.         $p = $web->tohtml($result->pronunciation);
  1811.         $pipa = $web->tohtml($result->pronunciation_ipa);
  1812.         $spl = $web->tohtml($result->spelling_flag);
  1813.         $comments = $web->tohtml($result->comments);
  1814. d362 2
  1815. a363 1
  1816.         if ($spl == 0) {
  1817. d365 2
  1818. a366 1
  1819.             $spl = "Modern<br>(after 1972)";
  1820. d368 2
  1821. a369 1
  1822.         } else {
  1823. d371 2
  1824. a372 7
  1825.             $spl = "Old<br>(before 1972)";
  1826.         }
  1827.  
  1828.         if ($comments == "") {
  1829.  
  1830.             $comments = "N/A";
  1831.         }
  1832. d374 2
  1833. a375 11
  1834.         foreach($parts_of_speech as $part_of_speech) {
  1835.  
  1836.             if ($pos == $part_of_speech->pkey) {
  1837.  
  1838.                 $pos = $part_of_speech->part_of_speech;
  1839.  
  1840.                 $pos = $web->tohtml($pos);
  1841.  
  1842.                 break;
  1843.             }
  1844.         }
  1845. d379 6
  1846. a384 6
  1847.         "<td>${language_value} </td>\n" .
  1848.         "<td>${pos} </td>\n" .
  1849.         "<td>${p} </td>\n" .
  1850.         "<td>${pipa} </td>\n" .
  1851.         "<td>${spl} </td>\n" .
  1852.         "<td>${comments} </td>\n" .
  1853. a388 3
  1854.  
  1855.     $errstr = 
  1856.     $indonesia->log_search($visitor, $language_flag, 0, $matches, 0); 
  1857. @
  1858.  
  1859.  
  1860. 1.2
  1861. log
  1862. @*** empty log message ***
  1863. @
  1864. text
  1865. @a39 5
  1866. if (session_is_registered("NODUP_SEND_EMAIL")) {
  1867.  
  1868.     session_unregister("NODUP_SEND_EMAIL");
  1869. }
  1870.  
  1871. @
  1872.  
  1873.  
  1874. 1.1
  1875. log
  1876. @Initial revision
  1877. @
  1878. text
  1879. @d5 33
  1880. a37 1
  1881.  
  1882. @
  1883.  
  1884.  
  1885. 1.1.1.1
  1886. log
  1887. @Bahasa Indonesia Dictionary
  1888. @
  1889. text
  1890. @@
  1891.