> thanks for all your replies, i'm now looking to dynamic programming... Id better warn you before you go further. "Notice that LCS is often defined to be finding all common subsequences of a maximum length. This problem inherently has higher complexity, as the number of such subsequences is exponential in the worst case"
This means that if you have 10 sentences with 5 words in each there is 5^10 space and time complexity. Definitelly, there are better algorithms from dynamic programming, but you should review your needs: how many sentences, words you have. There can be easier way than dynamic programming. Oleg -- http://mail.python.org/mailman/listinfo/python-list