Grayda
07-17-2003, 06:30 PM
Right now, goto www.googel.com (note the misspelling). Google will still come up. Is there a way I can have something like this in my projects. I want to make it so if the user enters a word, and 75% of it's right, then it will still accept instead of displaying an error? I know there is a Like command within vb, but that's not for text (I think.)
blindwig
07-17-2003, 06:42 PM
Right now, goto www.googel.com (note the misspelling). Google will still come up. Is there a way I can have something like this in my projects. I want to make it so if the user enters a word, and 75% of it's right, then it will still accept instead of displaying an error? I know there is a Like command within vb, but that's not for text (I think.)
The reason that works is because google has purchased the googel domain and redirects all traffic there to google. To do something similiar in VB, you'd need to build a database of misspellings and their corrections. Note it doesn't have to be an actual database, an array would work.
So like:
type StringCorrection
actual as string
replacement as string
end type
Dim Correction() as StringCorrection
private sub BuildDB
'redim and populate the Correction array
end sub
private sub FixMyCrappySpelling(ByRef strIn as string)
for i=lbound(Correction) to ubound(Correction)
strIn=replace(strIn, Correction(i).actual, Correction(i).replacement)
next i
end sub
Squishy
07-17-2003, 06:45 PM
I have no idea how much code it takes to make a spell-checker, but in theory, that could be used by replacing what they type with the most probable match...
It sounds like what you want is "Soundex" (pun intended - sorry :p ). A search in google (soundex vb) produces some links that look promissing.
Grayda
07-17-2003, 07:37 PM
Thanks for your help. I'll check them out and let you know :)