Topic awaiting preservation: Something to group results with a little "artificial intelligence" (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: f(x) |
posted 06-22-2005 01:32
Ok, I don't know how exactly to explain this, but here it goes...
|
Maniac (V) Inmate From: under the bed |
posted 06-22-2005 02:27
I Would write a script to add the correct ID, should be able to loop through those results in a couple seconds.... |
Bipolar (III) Inmate From: f(x) |
posted 06-22-2005 02:46
Maybe I'm thinking to complicated, but I'm wanting to relate the groups without the script initially knowing what to look for. Just to try and find exact phrases in records next to each other. I allready have IDs accociated with the records in the database. The IDs do not determine the order the records go in, there is a special order they go in and related items are allways grouped up next to each other in that order. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-22-2005 03:22
What your asking about is not easy. What you are asking for is something that you will find hundreds of PHD students working on at any given time, and much of that work is just in models, and will never be implimented. code: $rank = 3; $sql = "select title from table"; $results = query($sql); while($line = fetch($result)){ $wordarray = explode($line['title']) for($i = 0; $i<len($wordarray);$i++){ for($j = $i+1; $j <len($wordarray); $j++){ $substring = getSubstring($wordarray,$i,$j); //creates a substring of the words form $i to $j in $wordarray $sql = "select id, title from table where title like %substring%" $resuts = query($sql); if(numrows($results) > $rank){ //some code to put all of the ids into a relationship table } } } }
|
Bipolar (III) Inmate From: f(x) |
posted 06-22-2005 03:34
Thank you... |
Maniac (V) Inmate From: under the bed |
posted 06-22-2005 04:14
I'm not sure I follow the 'special order that they go in' bit - you have over 2000 records, and you have them all in 'special order' based on things that can be grouped together? |
Bipolar (III) Inmate From: f(x) |
posted 06-22-2005 19:31 |