Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Result:<S> Who/WP is/VBZ <NP1> the/DT author/NN </NP> of/IN <NP2> the/DT book +/NN </NP> ,/,/*comma* "/"/*\ quote* <NP3> The/DT Iron/NNP Lady/NNP </NP> :/: <NP4> A/DT Biography/N +NP of/IN \Margaret/NNP That\ cher/NNP </NP> "/"/*quote* ?/./*end-of-sentence*</S>
So far, I am getting nothing with the match, no even with the replacement<S> Who/WP is/VBZ the author/NP of/IN the book/NP ,/, The Iron Lady +/NP :/: A Biography of Margaret That\ cher/NP "/"...
if ($sentence =~ / (<NP\d*>) ([a-zA-Z0-9.-_]+)\/([A-Z]+) ([^ ]+) (<\/ +NP>) /) { $text="NounPhrase"; # to test the match to replace $result =~ s/$question/$text/; print "$result";};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I extract a text between some delimiters
by jkahn (Friar) on Sep 13, 2002 at 18:23 UTC | |
by adrianh (Chancellor) on Sep 15, 2002 at 01:26 UTC | |
by Anonymous Monk on Sep 16, 2002 at 19:58 UTC | |
|
Re: How do I extract a text between some delimiters
by fglock (Vicar) on Sep 13, 2002 at 18:09 UTC | |
by fglock (Vicar) on Sep 17, 2002 at 15:43 UTC | |
by Anonymous Monk on Sep 17, 2002 at 15:36 UTC |