Igalapedia
World Languages and Cultural Documentation Project
Igala Studies Igala Dictionary- Type any Igala alphabet to
see suggestion for Igala words
Please enter a search…
“;
// exit;
}
// check for a search parameter
if (!isset($var))
{
// echo “
We dont seem to have a search parameter!
“;
// exit;
}
$wpdb_old = wp_clone($GLOBALS[‘wpdb’]);
$wpdb_new = &$GLOBALS[‘wpdb’];
// All you have to care about following two lines
$wpdb_new = new wpdb(‘igalaped_abdul’,’fatimaabdul’,’igalaped_wordnet30′,’localhost’);
$wpdb_new->set_prefix(‘wp_’);
//Now whatever function you’ll call, it will use new database
$count = 1;
$wordid;
$lemma;
$synsetid;
$sample;
$pos;
$def;
$sample2[]=array();
$lexdomains[]=array();
// Build SQL Query
$query = “select * from words where lemma like \”$trimmed\””;
$result = mysql_query($query) or die(“Couldn’t execute query”);
if(mysql_num_rows($result)==0){
echo “
“;
// is not in the dictionary..try another word?
}
else
{
while($row= mysql_fetch_array($result))
{
$wordid=$row[“wordid”];
$lemma=$row[“lemma”];
echo “
“;
}
// transpose results from lemma to senses table
$query2 = “select * from senses where wordid like \”$wordid\””;
$resulta2 = mysql_query($query2) or die(“Couldn’t execute query”);
while($row= mysql_fetch_array($resulta2))
{
$synsetid=$row[“synsetid”];
$sample2[]=$synsetid;
$title = $row[“wordid”] . ” ” . $row[“senseid”];// . ” ” . $row[‘sensekey’];
}
// transpose results from synsets to lexdomains table
$query3 = “select * from synsets where synsetid like \”$sample2[0]\””;
$resulta3 = mysql_query($query3) or die(“Couldn’t execute query”);
while($row= mysql_fetch_array($resulta2))
{
$lexdomainid=$row[“lexdomainid”];
$lexdomains[]=$lexdomainid;
$title = $row[“lexdomainid”] . ” ” . $row[“lexdomainname”];// . ” ” . $row[‘pos’];
}
//make the sample array contain only one array, removing 0->0 from array $sample2
unset($sample2[0]);
unset($lexdomains[0]);
for($i=0;$i<(count($sample2)+1);$i++)
{
//create variable variables so result_A1 = synsetid#1, and so forth
${result_A.$i}=$sample2[$i];
//create variable variables so lexdomains_var = lexdomainid#1, and so forth
${lexdomains_var.$i}=$lexdomains[$i];
${query.$i} = "select * from synsets where synsetid like \"${result_A.$i}\"";
${result.$i} = mysql_query(${query.$i}) or die("Couldn't execute query");
${query_b.$i} = "select * from lexdomains where lexdomainid like \"${lexdomains_var.$i}\"";
${result_b.$i} = mysql_query(${query_b.$i}) or die("Couldn't execute query");
${query_c.$i} = "select * from samples where synsetid like \"${result_A.$i}\"";
${result_c.$i} = mysql_query(${query_c.$i}) or die("invalid query" . mysql_error());
while($row=mysql_fetch_array(${result.$i}))
{
${pos.$i}=$row["pos"];
if(${pos.$i}=="s"){
${pos.$i}="satellite adj";}
echo " ${pos.$i} ";
$def = $row["definition"];
echo '(‘ .$count . ‘): ‘ . $def;
$count++;
}
while($row=mysql_fetch_array(${result.$i}))
{
}
while($row=mysql_fetch_array(${result_c.$i}))
{
$sample=$row[“sample”];
if(!$sample==””)
// echo “[\” $sample \”]”;
echo ‘ [‘.$sample.’] ‘;
}
echo “
“;
}
}
// mysql_close($con);
//global $wpdb;
//We are done so lets take the old wpdb back on its position
$wpdb_new = $wpdb_old;
?>