Finding compound words?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ron_j_m
Forum Commoner
Posts: 35
Joined: Wed Feb 02, 2005 8:56 pm

Finding compound words?

Post 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
Post Reply