Potential English Counterparts"; $searchArray = array("R", "A", "V", "N"); $replaceArray = array("adv", "adj", "v", "n"); while($row = mysql_fetch_assoc($qry_result)) { $members = explode(" @ ", $row["bow_ch_syn"]); if(in_array($single_word,$members)){ $pos = str_replace($searchArray,$replaceArray,$row["bow_pos"]); $reference .= "
  • $row[bow_lemma] ($pos):
  • "; $reference .= "
    $row[bow_mean]

    "; } } */ }else{ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwikin"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM mixed"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); $c = 0; //$good = array("NA", "NANA", "NANANA", "NANANANA", "NANANANANA", "NANANANANANA", "NANANANANANANA", "NANANANANANANANA", "NANANANANANANANANA"); while($row = mysql_fetch_assoc($qry_result)) { //if(in_array($row['cwn_all'], $good)){ //echo $row["bow_ch_syn"]; $c++; //} } $rowsperpage = 5; $totalpages = ceil($c/$rowsperpage); if (isset($_GET['page']) && is_numeric($_GET['page'])) { $currentpage = (int) $_GET['page']; } else { $currentpage = 1; } if ($currentpage > $totalpages) { $currentpage = $totalpages; } if ($currentpage < 1) { $currentpage = 1; } $offset = ($currentpage - 1) * $rowsperpage; $sql = "SELECT * FROM merged WHERE cwn_all IN ('NA', 'NANA', 'NANANA', 'NANANANA', 'NANANANANA', 'NANANANANANA', 'NANANANANANANA', 'NANANANANANANANA', 'NANANANANANANANANA') LIMIT $offset, $rowsperpage"; mysql_query("SET NAMES 'utf8'"); $result = mysql_query($sql) or die(mysql_error()); /*while ($list = mysql_fetch_assoc($result)) { echo $list['id'] . " : " . $list['bow_ch_syn'] . "
    "; }*/ $code_array = array(); $searchArray = array("R", "A", "V", "N"); $replaceArray = array("adv", "adj", "v", "n"); while($things = mysql_fetch_array($result)){ $code_array[$things['id']] = $things['bow_ch_syn']; $bow_lemma[$things['id']] = str_replace("_"," ",$things['bow_lemma']); $bow_pos[$things['id']] = str_replace($searchArray,$replaceArray,$things['bow_pos']); $bow_mean[$things['id']] = $things['bow_mean']; } //print_r($code_array); /*foreach($code_array as $key => $value) { echo $key. " " . $value . "
    "; }*/ $entrystart = $offset+1; $entryend = $entrystart+count($code_array)-1; $entrytotal = number_format($c); $info = "$entrystart - $entryend (of $entrytotal entries)"; } ?> CWIKIN - A wiki that helps quicken the development of Chinese Wordnet

    fb
    $current_sense"; $current_sense++; } if ($records==""){ $records = ""; } return preg_replace('/kbdoff/', 'kbdon', $records, 1); } function total_sense($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwn"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM cwikin_raw WHERE spec = '$spec' ORDER BY date DESC"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $senses[] = $things['sense_id']; } $highest = max($senses); if (empty($senses)){ $highest = 1; } return $highest; } function history($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwn"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM cwikin_raw WHERE spec = '$spec' AND sense_id = 1 ORDER BY date DESC"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $records .= "* ".$things['date']." by
    ".$things['name']." (".$things['user'].")

    "; } return $records; } function part($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwn"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM cwikin_raw WHERE spec = '$spec' AND sense_id = 1 ORDER BY date DESC limit 1"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $record = $things['pos']; } return $record; } function definition($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwn"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM cwikin_raw WHERE spec = '$spec' AND sense_id = 1 ORDER BY date DESC limit 1"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $record = $things['gloss']; } return $record; } function exsen($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwn"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM cwikin_raw WHERE spec = '$spec' AND sense_id = 1 ORDER BY date DESC limit 1"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $record = $things['exsen']; } return $record; } function synonymy($synset, $spec){ if (strpos($synset, "@") !== false){ //$synonymy = str_replace(" @ " ,"、",$synonymy); //$synonymy = preg_replace("/、/" ," ]"; $members = explode(" @ ", $synset); $length = count($members)-1; $synonyms = "
    Potential Chinese Synonyms
    $synonyms"; for ($i=0; $i<$length; $i++) { $def = definition($spec); $exact = $i+1; $sno = $exact * 100000 + 130000 + $spec; //$synonyms .= '
    '.' in the sense of
    '; $synonyms .= "* $members[$exact]
    "; } $synonyms .= "
    "; return $synonyms; } } function relationship($spec){ $dbhost = "localhost"; $dbuser = "root"; $dbpass = "lopeej03xu3"; $dbname = "cwikin"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT * FROM relation WHERE spec = '$spec' AND sense_id LIKE '01'"; mysql_query("SET NAMES 'utf8'"); $qry_result = mysql_query($query) or die(mysql_error()); while($things = mysql_fetch_array($qry_result)){ $lr = ""; $records .= "
    ".$lr."
    "; } if($records==""){ $records = "
    "; } return $records; } $page_count = count($code_array); if ($page_count > 0){ foreach($code_array as $key => $value){ $members = explode(" @ ", $value); $synonyms = synonymy($value, $key); $senses = sense($key); $total_sense = total_sense($key); $pos = part($key); if($pos!=""){ if ($pos == 'n'){ $pos_set = "";} if ($pos == 'v'){ $pos_set = "";} if ($pos == 'adj'){ $pos_set = "";} if ($pos == 'adv'){ $pos_set = "";} if ($pos == 't'){ $pos_set = "";} if ($pos == 'i'){ $pos_set = "";} if ($pos == 'p'){ $pos_set = "";} if ($pos == 'c'){ $pos_set = "";} if ($pos == 'dm'){ $pos_set = "";} }else{ $pos_set = ""; } $definition = definition($key); $exsen = exsen($key); $records = history($key); $relations = relationship($key); echo "
    Potential English Counterparts
    $bow_lemma[$key] ($bow_pos[$key]):
    $bow_mean[$key]

    $synonyms
    Lemma Editing History
    $records

    $members[0]SENSE $senses

    $pos_set


    $relations

    "; } } if ($_GET['word']){ /*echo "
    $reference

    [ $single_word ]

    click here to edit

    click here to edit

    click here to edit

    "; */ echo "

    "; } ?> 0){ $lastpage = $currentpage - 1; $nextpage = $currentpage + 1; if ($lastpage < 1){ echo "
    "; } if ($nextpage > $totalpages){ echo "
    "; } if ($lastpage > 0&$nextpage < $totalpages+1){ echo "
    "; } } ?>