H
Honest John
I am trying to filter every combination of ten letters through a spell
checker, and so find valid english words. I have a problem in that ten
factorial, is over three point-six million words to filter, and
results in the computer crashing. (The computer is an old 2.66GHz P4
and just not up to the task).
Any suggestions how I can save computer resources?
#--------%<--------%<-----------------------------------------------------------------------------
use Algorithm::Combinatorics qw(permutations);
use Text::Aspell;
my $speller = Text::Aspell->new; die unless $speller;
# Set some options
$speller->set_option('lang','en_US');
$speller->set_option('sug-mode','fast'); # check a word
my @data = qw(s f e e r t v c o h);
my @words = grep $speller->check ( join '', @$_ ),
permutations(\@data);
print "\nSolution\n";
print map "@$_\n", @words;
checker, and so find valid english words. I have a problem in that ten
factorial, is over three point-six million words to filter, and
results in the computer crashing. (The computer is an old 2.66GHz P4
and just not up to the task).
Any suggestions how I can save computer resources?
#--------%<--------%<-----------------------------------------------------------------------------
use Algorithm::Combinatorics qw(permutations);
use Text::Aspell;
my $speller = Text::Aspell->new; die unless $speller;
# Set some options
$speller->set_option('lang','en_US');
$speller->set_option('sug-mode','fast'); # check a word
my @data = qw(s f e e r t v c o h);
my @words = grep $speller->check ( join '', @$_ ),
permutations(\@data);
print "\nSolution\n";
print map "@$_\n", @words;