Page 1 of 1

Finding compound words?

Posted: Tue Aug 09, 2005 7:47 pm
by ron_j_m
I'm trying to find a list of compound words from a table in a database that contains some words, some compound words and some values are gibberish. I'm currently using wordnet to find words and it works good. I would like to take this a step further to find compound words, but as I'm still new to php/mysql I'm a little stumped on how to get it done.
Here is the query im using to find single words

Code: Select all

$result = mysql_query("SELECT `$date`.id, `$date`.name FROM `$date` INNER JOIN wn_synset ON `$date`.name=wn_synset.word")or die ('I cannot connect to the database1 because: ' . mysql_error());
while ($row1 = mysql_fetch_array($result)) {
   $key = $row1['id'];
   $w = "1";
   $query = "UPDATE `$date` SET word='".$w."' WHERE id='$key'";
   mysql_query($query)or die ('I cannot connect to the database2 because: ' . mysql_error());

I don't know if I could find compound words through a query or if I need to do it through php somehow..
Any suggestions??

Thanks
Wrench