From 343ca03fe46ac48328de1860bfcf8dd6c0a83027 Mon Sep 17 00:00:00 2001 From: funderburkjim Date: Thu, 3 Dec 2020 16:48:30 -0500 Subject: [PATCH] Allow Devanagari or IAST in /simple/xxx. Ref: https://github.com/sanskrit-lexicon/csl-apidev/issues/18#issuecomment-738339213 --- simple-search/v1.0/getword_list_1.0.php | 13 ++-------- simple-search/v1.0/getword_list_1.0_main.php | 7 +++--- simple-search/v1.0/list-0.2s_rw.php | 25 ++++++++++---------- simple-search/v1.0/list-0.2s_xampp_rw.php | 21 +++++++++------- 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/simple-search/v1.0/getword_list_1.0.php b/simple-search/v1.0/getword_list_1.0.php index 88115dc..9374467 100644 --- a/simple-search/v1.0/getword_list_1.0.php +++ b/simple-search/v1.0/getword_list_1.0.php @@ -1,16 +1,7 @@ .xml - Enhancement: retrieve multiple headwords - Enhancement: retrieve based on normalized spelling - 06-02-2017. In this version, the variants are generated by php, rather - than being pregenerated by javascript - 06-05-2017. Compute variants with SLP + getword_list_1.0.php Begun 06-01-2017. + Used by Javascript 'simpleFunction' in list-0.2s_rw.php. */ require_once('getword_list_1.0_main.php'); $ans = getword_list_processone(); // Gets arguments from $_REQUEST diff --git a/simple-search/v1.0/getword_list_1.0_main.php b/simple-search/v1.0/getword_list_1.0_main.php index b0acaeb..e25f8e4 100644 --- a/simple-search/v1.0/getword_list_1.0_main.php +++ b/simple-search/v1.0/getword_list_1.0_main.php @@ -37,16 +37,17 @@ function getword_list_processone() { $dal = new Dal($dict); // WARNING: the relative path to sanhw1 is sensitive to location of // this file. -#$dalnorm = new Dalnorm('hwnorm1c','../../../sanhw1'); $dalnorm = new Dalnorm('hwnorm1c','../hwnorm1'); // Ordering of results depends on a word frequency file. $wfreqs = init_word_frequency(); // keyparmin is the key input. It is what the user requested. +// Assumed to be in utf-8 encoding $keyparmin = $getParms->keyin; // original dbgprint($dbg,"keyparmin=$keyparmin\n"); - -//keyparmin is original. +// php function. Convert back to utf-8 +// This is done already in javascript list-0.2s_(xampp)_rw.php +//$keyparmin1 = urldecode($keyparmin); $ssobj = new Simple_Search($keyparmin,$dict); $keysin = $ssobj->normkeys; // normalized slp1 spelling // 11-01-2017. user keyin, slp1, norm. So we can identify diff --git a/simple-search/v1.0/list-0.2s_rw.php b/simple-search/v1.0/list-0.2s_rw.php index 8ddb932..f63f447 100644 --- a/simple-search/v1.0/list-0.2s_rw.php +++ b/simple-search/v1.0/list-0.2s_rw.php @@ -1,11 +1,7 @@ $val
\n"); } @@ -60,7 +61,6 @@ list-0.2s Cologne - @@ -168,7 +168,7 @@ changeCorrectionHref = function () { //console.log('changeCorrectionHref: dict=',$('#dict').val()); var dict = $('#dict').val(); - var url = "/php/correction_form.php?dict=" + dict; + var url = "//www.sanskrit-lexicon.uni-koeln.de/php/correction_form.php?dict=" + dict; $('#correction').attr('href',url); }; keyAutocompleteActivation = function () { @@ -270,7 +270,7 @@ //console.log('test: find_word=',find_word); test.key = find_word; // 04-18/2018. change from v1.0d to v1.0 - // Currenlty getword_list_1.0.php same in both locations. + // Currently getword_list_1.0.php same in both locations. test.url = "../../simple-search/v1.0/getword_list_1.0.php"; //console.log('simpleFunction test.url=',test.url); test.input = 'hk'; @@ -483,8 +483,7 @@ classattr = ' class="sdata"'; // control font for Devanagari }); // end ready - +