[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] See the the message body



On Fri, Mar 17, 2000 at 08:47:13PM -0500, Michael G Schwern wrote:
> On Fri, Mar 17, 2000 at 05:09:08PM -0800, Yitzchak Scott-Thoennes wrote:
> > Let's fix that.  Tom C, not that long ago, posted a script to find all
> > the cases of repeated words in the core pods (including, if I remember
> > right, "the L<link>" or "L<link> manpage"--or was that a separate
> > script?).
> > 
> > Can anyone improve (in any sense of the word) on it?
> > (The basic algorithm, not necessarily the same functionality).
> 
> I dunno, what more do you need than:
> 
> for( $last_word = '';  ($word) = $text =~ /(\w+)/g;  $last_word = $word ) {
>         print "Repeated word $word" if $last_word eq $word;
> }


while ($text =~ /\b(\w+)\W+(?=\1\b)/g) {
      print "Repeated word $1\n";
}


Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe