best way to align words?

Oleg Batrashev ogbash at gmail.com
Sat Dec 2 08:08:55 EST 2006


> 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




More information about the Python-list mailing list