HI Greg

I have not had a look at the VB code you linked to but two things that occur to 
me are:- 

1. you would not want to do this sort of processing in MapBasic as it is 
Interpreted and typically takes 10 times as long as VB.

2. MapInfos data indexing provides good performance but if you are comparing 
every user string against all values you would not be able to make use of this 
index.

Two routes to go therefore come to mind. 

1. As you only have 25618 strings to compare with these could be held in memory 
in a C based DLL. The comparisons you are doing against a memory array would be 
very fast indeed.

2. Could you possibly turn the solution around by adding common mistypings to 
the original list? As said earlier MapInfos search against an index is good so 
even if you had 25 million records in the table ( ie 1000 mistyings per each 
real value ) an indexed search would be fast. You want an additional field to 
say what the real string is for each mistyping. Could you perhaps also pre 
store the "score" for each of these strings?

Perhaps a "half way" to this second solution is to add these mistypings to your 
master list as they occur ie when your end user types them in. The first time 
they occur you would get a time delay but next time they would be found 
immediately.

Its certainly an interesting challenge!


Regards


Bob



Quoting "Driver, Greg 9434" <[EMAIL PROTECTED]>:

> I've written a simple UK placename search tool which basically reads the
> user input and does a search on a MapInfo table (25618 rows) using and an
> SQL select statement to find an exact match.  This bit works fine.  The
> speed issue arises when an exact match isn't found.  I wanted to do some
> sort of spell checking, to find the closest matching entries in the
> placename table to the string entered by the user.  Searching the web I
> came
> across the Levenshtein Distance (LD), which is a measure of the similarity
> between two strings and I've used this as my spell checking routine.  This
> works well but the whole process of reading and checking each record in the
> placename table and testing it against the input string can take awhile to
> do, too long to make it useable!
> 
> I guess the question is, can I do anything to speed this process up?  The
> code that does the LD checking basically consists of for..next loops that
> steps through the two strings to be compared and tests each character and
> stores the resultant 'score' in a multi-dimensional array (see the link
> below for VB source code).  Am I expecting too much of MapBasic to do this
> sort of processing or is reading through a table of 25618 excessive?  Is
> there an alternative to developing in MapBasic (writing a VB or Delphi
> DLL)?
> I could convert the MapInfo table into an Access db if that would make any
> difference?  
> 
> See this link http://www.merriampark.com/ld.htm#WHATIS for an explanation
> of
> LD and some VB source code.
> 
> Thanks in advance.
> 
> Greg
> 
> 
> 
> 
> 
> Internet communications are not secure and therefore Surrey Police does not
> accept legal responsibility for the contents of this message.  This email
> and any attachments may be confidential. They may contain privileged
> information and are intended for the named addressee (s) only. They must
> not
> be distributed without our consent. If you are not the intended recipient,
> please notify us immediately and delete the message and any attachments
> from
> your computer, do not disclose, distribute, or retain this email or any
> part
> of it. Unless expressly stated, opinions in this email are those of the
> individual sender, and not of Surrey Police. We believe but do not warrant
> that this e-mail and any attachments are virus free. You must therefore
> take
> full responsibility for virus checking. Surrey Police reserves the right to
> monitor all email communications through their networks.
> 
> 
> 




---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9921

Reply via email to