Re: what is often before a pattern ?

2006-06-10 Thread joh12005
thanks, i 've checked, it may fit. i also find something about a longest common sequence which may be of interest, but i was unable to adapt it for list (words) rather than characters :( -- http://mail.python.org/mailman/listinfo/python-list

what is often before a pattern ?

2006-06-08 Thread joh12005
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

Re: grouping a flat list of number by range

2006-06-04 Thread joh12005
Hello > ... _, first_n = group[0] what is the meaning of the underscore "_" ? is it a special var ? or should it be readed as a way of unpacking a tuple in a non useful var ? like lost, first_n = group[0] best regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: grouping a flat list of number by range

2006-06-03 Thread joh12005
thanks to all ! my version was far less clever/long thant the one you posted, i'm going to examine all these with much interest, and learn... best regards. -- http://mail.python.org/mailman/listinfo/python-list

grouping a flat list of number by range

2006-06-01 Thread joh12005
hello, i'm looking for a way to have a list of number grouped by consecutive interval, after a search, for example : [3, 6, 7, 8, 12, 13, 15] => [[3, 4], [6,9], [12, 14], [15, 16]] (6, not following 3, so 3 => [3:4] ; 7, 8 following 6 so 6, 7, 8 => [6:9], and so on) i was able to to it withou

design a Condition class

2006-05-10 Thread joh12005
Hello, i posted for suggestions a little idea even if it still needs further thoughts but as i'm sure you could help :) if would like to implement some kind of Condition class which i coud use to build bricks of more complex condition, conditions are based on fields by using regexp class Conditi

multi regexp analyzer ? or how to do...

2005-06-29 Thread joh12005
Hello, here is a trouble that i had, i would like to resolve it with python, even if i still have no clue on how to do it. i had many small "text" files, so to speed up processes on them, i used to copy them inside a huge one adding some king of xml separator : [content] content is tab separa