home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3099 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
  2. From: Adam@beachyhd.demon.co.uk
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: "Fuzzy" string searching
  5. Date: 10 Feb 96 13:56:14 GMT
  6. Organization: Beachy Head - UK
  7. Message-ID: <311cf85e@beachyhd.demon.co.uk>
  8. X-NNTP-Posting-Host: beachyhd.demon.co.uk
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-GateSoftware: AmiGate 1.6 (13.11.95)
  13. MMDF-Warning:  Parse error in original version of preceding line at relay-4.mail.demon.net
  14. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!beachyhd.demon.co.uk
  15.  
  16. Hi all,
  17.  
  18. I wish to write a function that will perform a 'fuzzy' search for one string
  19. within another.
  20.  
  21. The most simple level of search is to just check if the 'search' string is in
  22. the 'source' string. So if I'm searching for 'test' in the string 'this is a
  23. test', it will obviously be found.
  24.  
  25. But I need to go further than that, and provide more intelligent searching. If
  26. I search for the word 'recent' in the string 'currency/recency', I still want a
  27. very close match to be indicated.
  28.  
  29. This becomes more difficult when searching (for example) for the word
  30. 'workload' in the string 'high work-load'. Never more than 4 characters match
  31. at any time, though obviously this should provide a very close match.
  32.  
  33. The idea is similar to that used in spell-checkers.. When the program doesn't
  34. recognise your word, it manages to search its dictionary for things it thinks
  35. are very close.
  36.  
  37. Does anyone have any suggestions or code that might allow me to perform this
  38. sort of search? Ideally a function that I pass two strings to, and which
  39. returns a score value within a given range (say, 0 to 100)..?
  40.  
  41. Thanks in advance,
  42.  
  43. .\dam.          [Team AMIGA]          //\ ad32@brighton.ac.uk \\/
  44.  
  45.