02-03-2007 09:04 PM
02-04-2007 10:10 PM
To do the sorting, construct an array of clusters { length, phrase }, so that length is FIRST in the cluster.
Then sort the array, and then reverse it (to get them in descending order).
That will guarantee you match "happy" ONLY if you did NOT match "happy dog".
You might need to consider whether you want to be case-sensitive or not.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-05-2007 06:40 AM
02-05-2007 08:52 AM
You want to put the same sentence into TWO folders: "love" and "happy dog", but not into "happy". Is that right?
But some other sentence you might want to put into a "happy" folder. Is that right?
The only way I see to do that is to somehow disqualify "happy" once you've matched "happy dog".
But you cannot disqualify "love", once you've matched "happy dog".
I think it would help for you to give more examples of sentences, and how you would deal with them.
Blog for (mostly LabVIEW) programmers: Tips And Tricks