Results 1 to 11 of 11

Thread: String Quasi-Matching

Threaded View

  1. #1

    Thread Starter
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    String Quasi-Matching

    I'm looking for a way to compare two strings, and return two percentages for each string's match against the other.

    Code:
    Private Function quasiString(str1 , str2) as Boolean 'return true if both match => 50%, _
    or one matches => 66% and the other is not below a certain threshold%, _
    or if either is 100%
    
    'Like passing "The Simpsons", "Simpsons"
    'would be 73% match and 100% match, so the function returns true(ignoring spaces)
    'Or passing "The Simpsons", "Simpsons, The"
    'would be 100% for both, ignoring also punctuation
    But I don't just want a binary one to one.

    I was thinking of splitting the strings using space(" ") as the delimiter, and comparing each substr individually.

    I was also thinking, to reduce the number of comparisons required, to Instr the array of substrs against the other full string, but this would also match strings inside of other substrs("How to: Ship Building" ,"NARUTO Shippiden", 35% and 40% instead of the 'correct' 0% and 0%), so 2 additional checks would be required to ensure it has a space or nothing(start/end of the string) surrounding it.

    It'd be useful if it could also match slightly mis-spelled variations of a word. I'm working mostly with proper names, so spell checking is somewhat limited(maybe I could have my app Google it ).

    I'm open to your ideas! (Do functions like this already exist? Are they any good?)
    Last edited by FireXtol; May 11th, 2010 at 09:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width