#!/usr/bin/perl # Soundex Collision Shower - Shows example collisions. # Brian Ristuccia use Text::Soundex; open DICT, "/usr/dict/words" or die "I'm dictless! ($?)"; print STDERR "Loading dictionary..."; while ($word = ) { chomp $word; $se=soundex $word; # print "$se\n"; if ( length($words{$se}) < 3 ) { $words{$se} = "$se: "; } $words{$se} = $words{$se} . $word . " "; } print STDERR "\n"; while ($line = <>) { $line =~ s/(\w*)/$words{(soundex $1)} . "\n"/gie; print $line; }