Hi,

You should try to run your routine without doing the actual LD computation.
Then you have a good guess, if a Delphi-DLL version would make much of a
difference. I guess it would, but looping through the table could also be a
significant part.

Kind regards

Uffe Kousgaard
www.routeware.dk

Driver, Greg 9434 wrote:
> 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


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

Reply via email to