Searching a dictionary file in DOS
- From: nessie235@xxxxxxx
- Date: Tue, 10 Jul 2007 21:44:23 -0700
I have an HP 100LX PDA that I want to use as a pocket German
translator. It is basically a DOS PC with a 16mhz 286 processer, 640k
RAM. and MS DOS 5.0. I found a nice dictionary list I want to use that
is 10mb. I have a 64mb CF flash card I can use to hold the list. The
list is not just pairs of words. It also contains short phrases. I
would want "peanut butter and jelly" to match a search for "peanut" as
well as a search for "butter" or "jelly". Using Turbo C++ 1.01
(available free from Borland), it took about 4 seconds to load a 64k
chunk of memory from Flash and less than a second to capitalize
everything and find the first occurrence of a search string using
strstr from string.h. The main bottleneck seems to be reading from
Flash.
Can anyone suggest an indexing or search method to minimize flash
access?
I thought about preparsing the file and making multiple entries for
any multiple word entry. In other words "peanut butter and jelly"
would appear in the list after "peanut" but also between "butter" and
"butterfly". That way, if the program loaded into RAM the section of
the file with all words beginning with "b" or "bu" looking for
"butter", "peanut butter and jelly" would also be found. Another idea
is to split the file up and do a simple search for single words pairs.
The more complex and time consuming search for multiple words could be
done while the user is looking at the results from the first search.
Those are the only ideas I have so far. Please let me know what you
think.
.
- Follow-Ups:
- Re: Searching a dictionary file in DOS
- From: John Doe
- Re: Searching a dictionary file in DOS
- From: Ico
- Re: Searching a dictionary file in DOS
- Prev by Date: JPEG format
- Next by Date: Re: stack and heap
- Previous by thread: JPEG format
- Next by thread: Re: Searching a dictionary file in DOS
- Index(es):
Relevant Pages
|