in reply to Re: A nice text processing question
in thread A nice text processing question
Looking at your code I'm not sure you understood.
I'm not trying to remove the tags. Rather imagine a long string of text that may or may not have some words (or group of words) bolded or marked up in some way.
Now, what I'm then doing is splitting it up into chunks, which may end up splitting a tagged words. So one chunk may have the opening tag, where another tag may have the closing tag. Or it might get split in the middle of two tags, so that a given chunk might have the *closing* tag from the previous chunk, and the *opening* tag that's not closed until the next chunk.
In other words:
Starting text:
<tag>This is a -- bunch</tag> of words <tag>where maybe -- some have</tag> tags.
Splitting on the double dash:
<tag>This is a
bunch</tag> of words <tag>where maybe
some have</tag> tags.
Which should then be corrected to:
<tag>This is a</tag>
<tag>bunch</tag> of words <tag>where maybe</tag>
<tag>some have</tag> tags.
I might check on the lwp list, too, since I'll probably move to HTML::Parser.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: A nice text processing question
by belden (Friar) on Jan 06, 2002 at 00:25 UTC |