Re: Permutations Problem



Honest John schrieb:
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);

Maybe using Math::Combinatorics instead could help. If I recall
correctly the permutations are calculated with each call to
next_permutation.

my $inp = Math::Combinatorics->new( [qw(s f e e r t v c o h)] );
while( my @permset = $inp->next_permutation )
{
my $searchword = join '', @permset;
push @words, $searchword if(
$speller->check( $searchword )
);
}

HTH
-Chris
.



Relevant Pages

  • Re: Permutations Problem
    ... I am trying to filter every combination of ten letters through a spell ... checker, and so find valid english words. ... rule-based but consult actual dictionaries for instance), ...
    (comp.lang.perl.misc)
  • Re: Permutations Problem
    ... Honest John wrote: ... checker, and so find valid english words. ... factorial, is over three point-six million words to filter, and ...
    (comp.lang.perl.misc)
  • Permutations Problem
    ... I am trying to filter every combination of ten letters through a spell ... checker, and so find valid english words. ...
    (comp.lang.perl.misc)
  • Re: Application for 2D filters with filter length >40 in image processing
    ... It has a marvelous tool in it called a "spell ... filters but it onli works for filter with larger filter lengthso i was wondring wat are the applications in such scenarios. ...
    (sci.image.processing)
  • Re: Was NUN: Bestellt, Bezahlt und nicht abgeholt ?
    ... Und schon hat man 95% alle Crackpots, Spammer, unflätiger Dummbeutel und sonstigen Personen ausgefiltert. ... Checker oder Filter zur unterscheidung von Realnamen zu Erfundenen ...
    (de.soc.recht.misc)