[Tutor] dictionary-ness ...

David Broadwell dbroadwell@mindspring.com
Wed May 14 00:19:01 2003


Well, I'm jumping in tot he dictionary subject feet first.

Anyone know of any good tutorials on them?

(the plan)

As a 'little' project, I'm planning on creating a tool to index all of the
words used in files on my HDD.
The best schema I have though of so far is dictionary storage as a prelim
stage to database ...
Wacking down to the 'words' in the files is trivial and with os.path.walk's
help, just a few minutes in the interpreter and I can grab the wordlist of
the files.

Now for the dictionary design, I was planning on as a stage one, the
dictionary being keyed on the first two letters of the word. No biggie ...
The real question is, let's say I have a ['word', 'wording'] in the list to
add to the dictionary, if I'm keying on 'wo' for both of them, I believe I'm
going to run into key name clashes.

So I went to the next level with the idea, keep the same key schema, but use
lists AS my value. Which would look like;
dict = {['wo',['word','wording]], ...}

Pointers?

--

David Broadwell