need some kind of "coherence index" for a group of strings
Fillmore
fillmore_remove at hotmail.com
Thu Nov 3 19:14:40 EDT 2016
On 11/3/2016 6:47 PM, jladasky at itu.edu wrote:
> On Thursday, November 3, 2016 at 1:09:48 PM UTC-7, Neil D. Cerutti wrote:
>> you may also be
>> able to use some items "off the shelf" from Python's difflib.
>
> I wasn't aware of that module, thanks for the tip!
>
> difflib.SequenceMatcher.ratio() returns a numerical value which represents
> the "similarity" between two strings. I don't see a precise
definition of
> "similar", but it may do what the OP needs.
>
I may end up rolling my own algo, but thanks for the tip, this does seem
like useful stuff indeed
More information about the Python-list
mailing list