in reply to Help with words scrambled
Even if your "same length" criteria is true, then based of the number of matching characters -- sk0oid .v. should -- there are 543 words in my dictionary that could be considered matches for sk0oid:
c:\test>junk33 sk0oid | find "33.33%" | wc -l 543
These range from:
c:\test>junk33 sk0oid | find "33.33%" sk0oid has a 33.33% chance of being: abroad sk0oid has a 33.33% chance of being: acarid sk0oid has a 33.33% chance of being: accord ... sk0oid has a 33.33% chance of being: shoots sk0oid has a 33.33% chance of being: shored sk0oid has a 33.33% chance of being: should sk0oid has a 33.33% chance of being: shoved sk0oid has a 33.33% chance of being: showed sk0oid has a 33.33% chance of being: shrewd sk0oid has a 33.33% chance of being: shroff sk0oid has a 33.33% chance of being: shrove sk0oid has a 33.33% chance of being: shuted ... sk0oid has a 33.33% chance of being: uphold sk0oid has a 33.33% chance of being: upload sk0oid has a 33.33% chance of being: verbid sk0oid has a 33.33% chance of being: vespid sk0oid has a 33.33% chance of being: vetoed sk0oid has a 33.33% chance of being: viscid sk0oid has a 33.33% chance of being: zeroed
You would need to come up with a heuristic that reflects the types of mistakes that your OCR program has a habit of making in order to get anything like good results.
The program used above:
#! perl -slw use strict; open W, '<', 'words.txt' or die $!; my @words = <W>; close W; chomp @words; chomp( my $bad = lc shift() ); for my $good ( @words ) { next if length $good != length $bad; my $mask = $good ^ $bad; my $match = $mask =~ tr[\0][]; next unless $match; printf "$bad has a %.2f%% chance of being: $good \n", $match / length( $good ) * 100; }
|
|---|