Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by allolex (Curate)
on Aug 30, 2003 at 08:56 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-26 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found