Re: $100 Contest Question

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message -----
From: <bensler at mail.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: $100 Contest Question


>
> Derek, are you using a preformatted version of words.txt, or are you
> formatting it within your program? It sounds like the latter, which I
> don't think is allowed.
>
> Chris
>
>

The short answer is both.

For comp#2, the algorithm I used when the matching routine is called was:
   If the internal dictionary is not set up,
       look for a file called 'dict.dat'.
       If that is present, use it's contents to
            set up the internal dictionary.
       otherwise look for 'words.txt'.
       If that is present, use it's contents to
            set up the internal dictionary, then
            write out the internal dictionary to
            'dict.dat' using a special format.

In either case, there is a small delay the first time the routine is called
while it initialises the internal dictionary. Only with the dict.dat file,
this delay is a lot smaller than with words.txt. Once the dictionary is set
up, find the matching words is lightening fast.

When I submitted my program to Robert yesterday, the wording of the
competition did not say "You must use words.txt contained in Junko's spell
checker in the Archive." So I guess the rules have changed after my
submission! Oh well. Of course, in one sense. I did use Junko's file - to
create a reformatted one - and I can use Junko's file if the dict.dat file
is not present.

I wrote the program as if it was to be used in the real world, not just some
artificial competetion environment. Thus the routine that uses words.txt is
not hyper-optimised as I was only going to use it once to create the
dict.dat file. That file is the optimised one.

If Robert rules against this concept, I guess I can submit another version
of the program.
-----
Derek.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu