Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Spell Check Logic

by robobunny (Friar)
on Jul 31, 2002 at 20:28 UTC ( #186596=note: print w/replies, xml ) Need Help??


in reply to Re: Spell Check Logic
in thread Spell Check Logic

you could speed this up a bit by maintaining a list of the words themselves in a separate hash, and checking that before you calculate the phonetic code (step 2). that way, you only have to calculate the code for words that are not in the list. of course, that only helps if most words are spelled correctly :)

Replies are listed 'Best First'.
Re: Re: Re: Spell Check Logic
by dree (Monsignor) on Jul 31, 2002 at 21:31 UTC
    You are right! :)

    But an hash (DB_File) with 2/3 millions words+phonetic codes is around 150+Mb.
    So to gain some speed-up you have to twice the database: one that has keys as phonetic codes and the second that has keys as correct words.
    And this is not always a good thing.

    But in this particulary case, with only 100.000+ words, your suggestion is ok :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://186596]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2019-05-26 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (153 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!