On Sat, Apr 24, 2010 at 7:43 PM, Santhosh Thottingal
<address@hidden> wrote:
Vasudev,
That is great idea. If we can keep the words in different buckets
based on the start letter, we effectively reduce the time to search
and get suggestions.
Having said that I guess there is another interesting way to achieve
this. How about this idea:
1. Keep all the words in single file itself.
2. Have an index file which will say : for this starting letter x,
this is the dictionary file and this is the starting line. Eg:
ക:456678 # all the words starting with ക is from line 456678
3. While reading the dictionary, we will do "random access" to the
dictionary file. Not by reading lines from top to bottom.
Look at the linecache module of the python to see how we can achieve this.
Thanks
Santhosh