Posted by Schraalhans Keukenmeester on 06/14/07 16:42
At Thu, 14 Jun 2007 08:35:23 -0400, FFMG let h(is|er) monkeys type:
>
> Hi,
>
> I am looking for a way to compare 2 short paragraphs that are almost
> the same.
>
> Is there some kind of algorithm that would allow us to compare the two
> and return some kind of likely hood of the text been the same?
>
> I am not talking about synonyms and complex things like that, simply
> sentences that have been changed by one or two words.
>
> Is there anything like that available?
>
> Thanks
>
> FFMG
Check out the soundex() and levenshtein() functions. They might be what
you need. Alternatively split your strings in words in arrays and use
array_intersect() to get an idea of the overlap.
HTH
--
Schraalhans Keukenmeester - schraalhans@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]
"strcmp('apples','oranges') < 0"
[Back to original message]
|