d 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 indic
On May 10, 1:26 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I have text file (english-croatian dictionary) with words in it in
> alphabetical
> order.
> This file contains 17 words in this format:
> english word: croatian word
Let's assume it's okay to have all the data in memory.
In m
On May 11, 2007, at 3:50 AM, Michael Bentley wrote:
>
> Here's an idea: use a rats' nest of dictionaries and do all the
> lookup work up front when you build the rats' nest. Maybe something
> like this:
...
Oops! This is better :-)
#! /usr/bin/env python
import pprint
dictionary = """absinth
Michael Bentley <[EMAIL PROTECTED]> wrote:
> >
> > Call me dense, but how does one do this in Python - which doesn't have
> > pointers? Dictionaries with dictionaries within dictionaries... (with
> > each letter as the key and the its children as values) is going to be
> > extremely space ineffici
On 2007-05-11, ciju <[EMAIL PROTECTED]> wrote:
> By the way, both data structures could be implemented as tuple
> in python, for I suppose, if only lookup is needed tuple gives
> better performance than list.
I used a list instead of a tuple where I thought a list would be
convenient while buildin
On May 10, 2007, at 12:26 PM, Gigs_ wrote:
> Hi all!
>
> I have text file (english-croatian dictionary) with words in it in
> alphabetical
> order.
> This file contains 17 words in this format:
> english word: croatian word
>
> I want to make instant search for my gui
> Instant search, i me
>
> Call me dense, but how does one do this in Python - which doesn't have
> pointers? Dictionaries with dictionaries within dictionaries... (with
> each letter as the key and the its children as values) is going to be
> extremely space inefficient, right?
Isn't *everything* in python essentially
On May 11, 3:12 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-05-10, Gordon Airporte <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> >> For the above (abrideged) dictionary, you would generate (use a
> >> fixed-width "programmers" font so the tree looks good):
>
> >> a
> >>
"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 wou
On 2007-05-10, Gordon Airporte <[EMAIL PROTECTED]> wrote:
>
>> For the above (abrideged) dictionary, you would generate (use a
>> fixed-width "programmers" font so the tree looks good):
>>
>> a
>> |
>> b
>> |
>> s
Gordon Airporte wrote:
>
>> For the above (abrideged) dictionary, you would generate (use a
>> fixed-width "programmers" font so the tree looks good):
>>
>> a
>> |
>> b
>> |
>> s
>> / \
>>
> For the above (abrideged) dictionary, you would generate (use a
> fixed-width "programmers" font so the tree looks good):
>
> a
> |
> b
> |
> s
> / \
>i o
> / /
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On 2007-05-10, Gigs_ <[EMAIL PROTECTED]> wrote:
| > if user type: "abs" program should list all words above in
| > english and in croatian if user type: "absorb" than program
| > should list last 3 words in english and i
On 2007-05-10, Gigs_ <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I have text file (english-croatian dictionary) with words in it
> in alphabetical order. This file contains 17 words in this
> format: english word: croatian word
>
> I want to make instant search for my gui Instant search, i mean
>
I have made a script that search anagram based on the ODS file ( call
OSW in english, Official Scrabble Words)
it load a file that contain 369085 words (one word per line)
I create a dictionnary and store word into using the length of the
word as key
example : mydict[2] contain a list of word with
Hi all!
I have text file (english-croatian dictionary) with words in it in alphabetical
order.
This file contains 17 words in this format:
english word: croatian word
I want to make instant search for my gui
Instant search, i mean that my program search words and show words to user as
user
16 matches
Mail list logo