Re: aligning text with space-normalized text
- From: John Machin <sjmachin@xxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 21:49:20 +1000
Steven Bethard wrote:
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
That is *exactly* my point -- it is not valid input, and you are not reporting all cases of invalid input; you have an exception where the non-spaces are impossible, but no exception where whitespaces are impossible.
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.
If it helps, you can re-read my message.
STeVe
.
- References:
- aligning text with space-normalized text
- From: Steven Bethard
- Re: aligning text with space-normalized text
- From: John Machin
- Re: aligning text with space-normalized text
- From: Steven Bethard
- aligning text with space-normalized text
- Prev by Date: Re: Which kid's beginners programming - Python or Forth?
- Next by Date: sys.ps2
- Previous by thread: Re: aligning text with space-normalized text
- Next by thread: Re: aligning text with space-normalized text
- Index(es):
Relevant Pages
|