"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
| Every node is a tuple of its letter, a list of its children, and
| a list of its words. So the two 'pelin' nodes would be (with 'e'
| referenced in the 'h' node):
|
| ('h', [('e', [], ['pelin'])], ['pelin'])
|
| That would in turn be "stored" in the t, n, i and s nodes.
[snip]

At the outer level, I would use a list in order to build the structure in 
pieces, one for each letter, and then add them in.

At the top level, the letters do not need explicit storage.  The first 
subtree is for words starting with 'a', etc.  In other words, the position 
of each subtree indicates its starting letter.  For most letters, this can 
be carried on another level.

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to