LCS for word ? or array intersection ?
John Machin
sjmachin at lexicon.net
Sun Jan 26 03:03:56 EST 2003
gregtehrig at yahoo.fr (Greg Tehrig) wrote in message news:<4c637994.0301231037.13113f5a at posting.google.com>...
> hi,
>
> i've got a question for the guys from here, i think this might be done
> by something like decorate/undecorate and LCS (Longest Common
> Sequence) but perhaps you had a better idea than mine.
>
> for example :
> s1 = """this is a line containing an example"""
> s2 = """this is another sentence containing 12 words and it is another
> example"""
>
> and need following output:
> ["""this is""", """containing""", """example"""]
> ["""a line""", """an example"""]
^^^^^^^^^^^^^^^^
This should be merely """an""", shouldn't it???
> ["""another sentence""", """12 words and it is another"""]
More information about the Python-list
mailing list