Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I extract the complete sentences from a text like the following :open INPUT, "< $filename" or die "Cannot open $filename for input: $!"; @text = <INPUT>; close (INPUT); $text = "@text"; @splittext = split(/$string/,$text); #To extract concordance lines from text for (my $i=1; $i < @splittext; $i++) { my $before = substr((' 'x10).$splittext[$i-1],-20,20); my $after = substr($splittext[$i].' 'x10,0,20); print p($before, strong($string), $after,"\n"), }
Thanx,I came across this before. I came down from Canada. I came back yesterday.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extract complete sentence
by Zaxo (Archbishop) on Oct 22, 2001 at 11:59 UTC |