我已经使用此代码来获取定义:
//assuming you've connected to your MySQL db
$word=$_GET['s']; //This variable stores the value given through url
if (ctype_alpha($word)){ // If it's alphabetical
$word_clean=mysql_real_escape_string($word); //Sanitize it for MySQL
}else{
//Not a valid word, error handle
exit();
}
$query='SELECT wordno FROM word WHERE lemma=`$word_clean` LIMIT 1';
$result=mysql_query($query);
$query='SELECT synsetno FROM sense WHERE wordno=`$wordno`';
$query='SELECT definition FROM synset WHERE synsetno=`$synset`';
但是现在我想获得该词的同义词和类似词($word);