On Tue, Dec 10, 2013 at 4:02 PM, Tamer Higazi wrote:
> Hi people!
>
> Is there a way to get dict by search terms without iterating the entire
> dictionary ?!
>
> Let us assume I have:
>
> {'Amanda':'Power','Amaly':'Higgens','Joseph':'White','
> Arlington','Black','Arnold','Schwarzenegger'}
>
> I
On Wed, Dec 11, 2013 at 6:02 PM, Ian Kelly wrote:
> This is what I did not so long ago when writing a utility for
> typeahead lookup, except that to save some space and time I only
> nested the dicts as deeply as there were still multiple entries. As
> an example of what the data structure looked
On Wed, Dec 11, 2013 at 7:30 AM, Tim Chase
wrote:
> On 2013-12-11 13:44, Steven D'Aprano wrote:
>> If necessary, I would consider having 26 dicts, one for each
>> initial letter:
>>
>> data = {}
>> for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
>> data[c] = {}
>>
>> then store keys in the particular d
On 11/12/2013 17:19, Travis Griggs wrote:
On Dec 11, 2013, at 5:31 AM, rusi wrote:
The classic data structure for this is the trie:
General idea: http://en.wikipedia.org/wiki/Trie
In python:
http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
My thoughts exactly!
I
On Dec 11, 2013, at 5:31 AM, rusi wrote:
>
> The classic data structure for this is the trie:
> General idea: http://en.wikipedia.org/wiki/Trie
> In python:
> http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
My thoughts exactly!
If you wade through the comments ther
On 11/12/2013 00:02, Tamer Higazi wrote:
Hi people!
Is there a way to get dict by search terms without iterating the entire
dictionary ?!
Let us assume I have:
{'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
I want to grab the dict's key and
On 2013-12-11 09:46, Roy Smith wrote:
> The problem is, that doesn't make a whole lot of sense in Python.
> The cited implementation uses dicts at each level. By the time
> you've done that, you might as well just throw all the data into
> one big dict and use the full search string as the key. I
On Wednesday, December 11, 2013 8:16:12 PM UTC+5:30, Roy Smith wrote:
> rusi wrote:
> > The classic data structure for this is the trie:
> > General idea: http://en.wikipedia.org/wiki/Trie
> > In python:
> > http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
> I agree t
In article <3efc283f-419d-41b6-ad20-c2901c3b9...@googlegroups.com>,
rusi wrote:
> The classic data structure for this is the trie:
> General idea: http://en.wikipedia.org/wiki/Trie
> In python:
> http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/
I agree that a trie fit
On 2013-12-11 13:44, Steven D'Aprano wrote:
> If necessary, I would consider having 26 dicts, one for each
> initial letter:
>
> data = {}
> for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
> data[c] = {}
>
> then store keys in the particular dict. That way, if I wanted keys
> starting with Aa, I woul
On Wed, 11 Dec 2013 12:07:08 +0200, Tamer Higazi wrote:
> Hi Dave!
>
> You were absolutely right.
> I don't want to iterate the entire dict to get me the key/values
>
> Let us say this dict would have 20.000 entries, but I want only those
> with "Aa" to be grabed.
> Those starting with these 2 l
Reordering to un-top-post.
> On 11.12.2013 06:47, Dave Angel wrote:
> > On Wed, 11 Dec 2013 02:02:20 +0200, Tamer Higazi wrote:
> >> Is there a way to get dict by search terms without iterating the
> > entire
> >> dictionary ?!
> >> I want to grab the dict's key and values started with 'Ar'...
>
Hi Peter!
I got the message
I know that I could have used a database. I am using for a good reason
the ZODB Database.
I am making things in the ZODB Database persistent, I don't like to
distribute among machines.
Making use of sqlite, won't give me the possibility to scale as the
amount
Tamer Higazi wrote:
> Hi Dave!
>
> You were absolutely right.
> I don't want to iterate the entire dict to get me the key/values
>
> Let us say this dict would have 20.000 entries, but I want only those
> with "Aa" to be grabed.
> Those starting with these 2 letters would be only 5 or 6 then it
Hi Dave!
You were absolutely right.
I don't want to iterate the entire dict to get me the key/values
Let us say this dict would have 20.000 entries, but I want only those
with "Aa" to be grabed.
Those starting with these 2 letters would be only 5 or 6 then it would
take a lot of time.
In whi
On Wed, 11 Dec 2013 02:02:20 +0200, Tamer Higazi
wrote:
Is there a way to get dict by search terms without iterating the
entire
dictionary ?!
I want to grab the dict's key and values started with 'Ar'...
Your wording is so ambiguous that each respondent has guessed
differently.
I'm gue
Tamer Higazi writes:
> Is there a way to get dict by search terms without iterating the
> entire dictionary ?!
(A language note: you may be unaware that “?!” does not connote a simple
question, but outrage or incredulity or some other indignant expression.
This implies not a polite query, but mo
On 2013-12-11 02:02, Tamer Higazi wrote:
> Is there a way to get dict by search terms without iterating the
> entire dictionary ?!
>
> Let us assume I have:
>
> {'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
On 11/12/2013 00:02, Tamer Higazi wrote:
Hi people!
Is there a way to get dict by search terms without iterating the entire
dictionary ?!
Let us assume I have:
{'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
I want to grab the dict's key and
Hi people!
Is there a way to get dict by search terms without iterating the entire
dictionary ?!
Let us assume I have:
{'Amanda':'Power','Amaly':'Higgens','Joseph':'White','Arlington','Black','Arnold','Schwarzenegger'}
I want to grab the dict's key and values started with 'Ar'...
I could ma
20 matches
Mail list logo