tags:

views:

257

answers:

1

Hello, I recently discovered a site that set certain code kata.

One of the Kata caught my eye and set me looking into Bloom filters.

I'm using PHP and MySql.

I have a table with roughly 45,000 words to act as a dictionary and i've written the code to create a bloom filter array.

My questions are...

  1. At what point should the code run to create the Bloom filter array a) When the user access the page b) Every time a search is run c) Just once by me and then stored for future use d) something else entirely

  2. How should I store the array a) Keep it in an array b) Write to a text file c) Create a new table and store it there d) something else entirely

Any help from someone experienced with bloom filters would be a great help.

Cheers Hangfire

+2  A: 

1) c (perhaps, in session).

2) a (in memory).

For only 45,000 words you could probably keep whole list in in-memory hash and still have fast lookups. Bloom filter may not be needed.

-- jorge.

jm
Thanks for the reply Jorge, I thought my post had been lost to the mists of time.Do you happen to know of any good articles/tutorials on the practical use of hash functions and lists? It's an area I need to boff up on but keep shying away from.RegardsHangfire
Hangfire
Just ask that question here on SO :) Instead of comments.
jm
BTW: I thought this was a good BLOOM FILTER article: http://www.perl.com/pub/a/2004/04/08/bloom_filters.html It's not PHP, but should still make sense.
jm