Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Constructive criticism of a dictionary / text comparison script

by allolex (Curate)
on Aug 30, 2003 at 08:56 UTC ( #287888=note: print w/replies, xml ) Need Help??


in reply to Re: Constructive criticism of a dictionary / text comparison script
in thread Constructive criticism of a dictionary / text comparison script

Oops!

sub findwords { open my $if, "<", $file || die "Could not open $file: $!"; while (<$if>) { chomp; my @elements = split(/[ '-]/,$_); # split on hyphens, too foreach my $element (@elements) { next if $element =~ /\d/; # Don't need digits $element = lc($element); $element =~ s/[\s,!?._;)("'-]//g; # thanks sauoq next if $element eq ''; print "[$element]\n" if $token_debug; if ( exists $dictionary{$element} ) { $dictionary{$element}++; } else { $glossary{$element}++; } } } }

Thanks a lot! I think that was another relic from a previous version. I'm glad you caught it.

--
Allolex

  • Comment on Re: Re: Constructive criticism of a dictionary / text comparison script
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://287888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-07-14 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?