Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Steven Bethard wrote: > Michael Spencer wrote: > >> Steven Bethard wrote: >> >>> I've got a list of word substrings (the "tokens") which I need to >>> align to a string of text (the "sentence"). The sentence is >>> basically the concatenation of the token list, with spaces sometimes >>> insert

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Michael Spencer wrote: > Steven Bethard wrote: > >> I've got a list of word substrings (the "tokens") which I need to >> align to a string of text (the "sentence"). The sentence is basically >> the concatenation of the token list, with spaces sometimes inserted >> beetween tokens. I need to d

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Fredrik Lundh wrote: > Steven Bethard wrote: > > I feel like there should be a simpler solution (maybe with the re module?) but I can't figure one out. Any suggestions? >>> >>>using the finditer pattern I just posted in another thread: >>> >>>tokens = ['She', "'s", 'gon', 'na', 'write',

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Fredrik Lundh
Steven Bethard wrote: >>> I feel like there should be a simpler solution (maybe with the re >>> module?) but I can't figure one out. Any suggestions? >> >> using the finditer pattern I just posted in another thread: >> >> tokens = ['She', "'s", 'gon', 'na', 'write', 'a', 'book', '?'] >> text = ''

Re: aligning a set of word substrings to sentence

2005-12-01 Thread Michael Spencer
Steven Bethard wrote: > I've got a list of word substrings (the "tokens") which I need to align > to a string of text (the "sentence"). The sentence is basically the > concatenation of the token list, with spaces sometimes inserted beetween > tokens. I need to determine the start and end offse

Re: aligning a set of word substrings to sentence

2005-12-01 Thread Steven Bethard
Paul McGuire wrote: > "Steven Bethard" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I've got a list of word substrings (the "tokens") which I need to align >>to a string of text (the "sentence"). The sentence is basically the >>concatenation of the token list, with spaces som

Re: aligning a set of word substrings to sentence

2005-12-01 Thread Paul McGuire
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've got a list of word substrings (the "tokens") which I need to align > to a string of text (the "sentence"). The sentence is basically the > concatenation of the token list, with spaces sometimes inserted beetween >

Re: aligning a set of word substrings to sentence

2005-12-01 Thread Steven Bethard
Fredrik Lundh wrote: > Steven Bethard wrote: >> I feel like there should be a simpler solution (maybe with the re >> module?) but I can't figure one out. Any suggestions? > > using the finditer pattern I just posted in another thread: > > tokens = ['She', "'s", 'gon', 'na', 'write', 'a', 'book',

Re: aligning a set of word substrings to sentence

2005-12-01 Thread Fredrik Lundh
Steven Bethard wrote: > I feel like there should be a simpler solution (maybe with the re > module?) but I can't figure one out. Any suggestions? using the finditer pattern I just posted in another thread: tokens = ['She', "'s", 'gon', 'na', 'write', 'a', 'book', '?'] text = '''\ She's gonna wr

aligning a set of word substrings to sentence

2005-12-01 Thread Steven Bethard
I've got a list of word substrings (the "tokens") which I need to align to a string of text (the "sentence"). The sentence is basically the concatenation of the token list, with spaces sometimes inserted beetween tokens. I need to determine the start and end offsets of each token in the sente