There have been already many solutions w/word list look up posted to this thread. I'll try to give a 'hands on' example (if you work on a windows box).

First, you could download a dictionary from

ftp://ftp.ox.ac.uk/pub/wordlists/american/dic-0294.tar.gz

and put it in a directory, eg. "c:\dic-0294" (extract it *there*, winrar or winzip should work)
You'll see ~30 different files, each containing words of a defined length.

Then, create a Perl script like the ones that have been posted in the thread or use one that is tailored for this dictionary, like:

use strict; use warnings; my $word = shift || 'OLHOSC'; my $fname = sprintf 'length%02d.txt', length $word; # eg. length06.tx +t my $word_key = join '', sort split //, lc $word; # sort lowercase +letters open my $fh, '<', $fname or die "sorry, no such word list available, +Bye!"; while( my $line = <$fh> ) { chomp $line; my $dict_key = join '', sort split //, lc $line; print "$word => $line\n" if $dict_key eq $word_key # bail out here - if only one match is needed } close $fh;

From the *length* of the looked-up word, the name of the dictionary file is built. If you extracted the above archive, then the files with word lengths between 2 and 32 should reside in the current directory.

Regards

mwa


In reply to Re: Found a word from a set of letters by mwah
in thread Found a word from a set of letters by vnpenguin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.