John Machin wrote: > If "work" is meant to detect *all* possibilities of 'chunks' not having > been derived from 'text' in the described manner, then it doesn't work > -- all information about the positions of the whitespace is thrown away > by your code. > > For example, text = 'foo bar', chunks = ['foobar']
This doesn't match the (admittedly vague) spec which said that chunks are created "as if by ' '.join(chunk.split())". For the text: 'foo bar' the possible chunk lists should be something like: ['foo bar'] ['foo', 'bar'] If it helps, you can think of chunks as lists of words, where the words have been ' '.join()ed. STeVe -- http://mail.python.org/mailman/listinfo/python-list