Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- # Our test cases will always use the same dictionary file (with SHA1
- # 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness`
- # will automatically download this dictionary for you if you don't
- # have it already.
- my $path = (shift @ARGV) || '/usr/share/dict/words';
- open FILE, "<$path";
- my %entries = map {chomp; $_ => 1} <FILE>;
- while (<>) {
- s/([^ \n]+)/(exists $entries{lc $1}) ? $1 : "<$1>"/ge;
- print;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement