Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
Books-on-demand
/
Upload File :
New :
File
Dir
/home/cluster1/data/bu01/1121861/html/Books-on-demand/test_2.php
<? include_once "utf8/utf8.class.php"; //header("Content-Type: application/xml"); header("Content-Type: text"); /**************************** MAIN *************************/ global $verbstem; if($condition == "story") { $word = strtolower($word); if(ereg("Am",$dialect)) { //$lxa = $word; //FOR NOW: $lxo = $word; } else if(ereg("Oa",$dialect)) { $lxo = $word; } $word = $lxo; $root_info = get_root_verb($word); if($root_info == "") { $xfst_path = "/spd25/htdocs/hyperlex2/nahuatl/xfst_dir/xfst -utf8 -e 'loadd SurfaceForms.fsm' -e 'regex GlSR;'"; $command = "$xfst_path -e 'apply down 3sgS-3sgO-".$word."-pres.sg' -stop"; unset($parse); $result = trim(exec($command,$parse)); if($result != "") { //echo "<BR>Oh my God, this may be a transitive verb! If the query did not include an object prefix, please try resubmitting with an object prefix. <BR><BR>If the query did contain a correct object prefix, then this verb is most likely an irregular verb that still does not parse.<BR>"; } else { //die("This word can not be parsed."); echo "<error>This word can not be parsed.<error>"; die (""); } } else { display_verb_table($root_info[0],$root_info[1]); } $urltoSenses = "http://hyperlex2.ldc.upenn.edu/nahuatl/search_results.php4?user_lang=english&condition=word_search&word=".$root_info[0]."&entry_template=englishwordsense.html&bg_template=english%senses_template.html"; } else { $words = strtolower($words); $words = explode("_",$words); $lxa = $words[0]; $lxo = $words[1]; //FOR NOW.... $word = $lxo; if(trim($form) == "") { $HOST = "wave.ldc.upenn.edu"; $USER = "hyperlex"; $PASSWORD = "jota"; $DATABASE = "hyperlex"; $TABLE = "nahuatl"; @ $db = mysql_pconnect($HOST, $USER, $PASSWORD); if(!$db) { echo "Error: Could not connect to database. Please try again later."; exit; } mysql_select_db($DATABASE); $query = "SELECT * FROM $TABLE"; $query_result = mysql_query($query); if(mysql_num_rows($query_result) == 0) { die("$lxo is not in the lexicon."); //echo "<error>$lxo is not in the lexicon.<error>"; die (""); } while($row = mysql_fetch_row($query_result)) { echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "/"; echo $row[0]; echo "<BR>"; /* $row[0] now contains the first column of the current row, index 1 is the second, etc. */ } $row = mysql_fetch_assoc($query_result); $psm = $row["psm"]; //echo "PSM: $psm <BR>"; if(ereg("V0|V1",$psm)) { $form = "intrans"; }else if(ereg("V2|V3",$psm)) { $form = "trans"; }else { //die("$lxo can not be parsed. Part of speech is $psm. Must have part of speech V0, V1, V2, or V3."); echo "<error>$lxo can not be parsed. Part of speech is $psm. Must have part of speech V0, V1, V2, or V3.</error>"; die(""); } } } ?>