Possible Duplicate:
Find longest repetitive sequence in a string
I'm working on a problem and I need to find pattern that's repeating most.
For simplicity and convenience please consider this string:
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...
Sequence that repeats most (initially considering string length greater the 3 characters, for example) is "Lorem Ipsum". "Lorem" and "Ipsum" also repeat the same number of times of course, but longer string has precedence over shorter if they repeat same number of times.
What kind of algorithm can efficiently find this pattern, preferably in Python?