[EMAIL PROTECTED] wrote: > Hello, > > i'm looking for a way to detect sequence objects which are often before > a pattern. > > say for example some list like: > > a = "a0 a1 a2 a3 a4 myPatternMatchHere".split() > b = "a5 a2 a4 myPatternMatchHere".split() > c = "a6 a7 a2 a3 a8 a4 myPatternMatchHere".split() > d = "a9 a10 a2 myPatternMatchHere".split() > > a2 a3 a4 is the most interesting because it appears 2 times upon 4, and > overlap a2 a4, and we have some clues that a2 is also important as it > appears 4/4. > > maybe have you some suggestions or idioms where i should look after > > best. >
Look into suffix trees. http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Tree/Suffix/ -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list