If looking through the table is a cause of slow speed, could storing the strings in a MB array improve the search/comparison operations?
Jacques Paris e-mail [EMAIL PROTECTED] MapBasic-MapInfo support http://www.paris-pc-gis.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 15-Jan-04 09:38 To: [EMAIL PROTECTED] Subject: RE: MI-L Speeding up a MapBasic tool Greg My experience has been that string searching of MI Tables is very slow, even when indexed - if you have the option of putting the function into a DLL and using a search on Access then you will see a dramatic improvement in performance. HTH Paul Crisp Syntegra Innovation Place Delta Bank Road Newcastle NE11 9DJ Tel 0191 461 4522 Fax 0191 460 1987 -----Original Message----- From: Driver, Greg 9434 [mailto:[EMAIL PROTECTED] Sent: 15 January 2004 14:25 To: MapInfo-L (E-mail) Subject: MI-L Speeding up a MapBasic tool 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. ******************************************************************** This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.syntegra.com ******************************************************************** --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 9920