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
|
|---|