Re: Testing for names that sounds alike
- From: John Spencer MVP <spencer@xxxxxxxxx>
- Date: Thu, 02 Apr 2009 14:32:28 -0400
No SOUNDEX is designed for matching names and even there it is not highly accurate.
Matching something like that is going to be VERY difficult. I would look at creating a custom vba function to try to regularize the names.
-- replace underscores with spaces
-- break the name down into pieces and keep the first 4 char of each word.
-- Keep the extension
Something like the following UNTESTED function
Public Function regularName(strIN, Optional iLen As Long = 4) As String
Dim StrOut As String
Dim vWords As Variant
Dim I As Long
If Len(Trim(strIN & "")) = 0 Then
regularName = strIN
Else
strIN = Replace(strIN, "_", " ")
vWords = Split(strIN, " ")
For I = 0 To UBound(vWords)
If Len(vWords(I)) > 0 Then
If InStr(vWords(I), ".") > 0 Then
StrOut = StrOut & " " & _
Left(Left(vWords(I), Len(vWords(I)) - 4), iLen) & _
Right(strIN, 4)
Else
StrOut = StrOut & " " & Left(vWords(I), iLen)
End If
End If
Next I
regularName = Mid(StrOut, 2)
End If
End Function
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Danny J. Lesandrini wrote:
John:.
It seems to me that the SoundEx function worked on names
and could say that Smyth is a lot like Smith. Can it, or your
function tell me that these two strings are alike?
ONC123 prot assign.pdf
ONC123_Protocol_Assignment.pdf
It's probably obvious what I am doing here. Got a directory
full of files that don't follow naming conventions. They are all
close, but spaces where underscores belong and abbrevs.
Assuming I replaced underscores with spaces before I did
the compare (or perhaps not), would your fSoundex function
work on this? If not, something else? Fuzzy compare Fn?
- References:
- Testing for names that sounds alike
- From: Anthony Fontana
- Re: Testing for names that sounds alike
- From: John Spencer MVP
- Re: Testing for names that sounds alike
- From: Danny J. Lesandrini
- Testing for names that sounds alike
- Prev by Date: Re: Select statment based on child rows
- Next by Date: Re: Weeks in month vs prior year (Access 2007)
- Previous by thread: Re: Testing for names that sounds alike
- Next by thread: Re: Testing for names that sounds alike
- Index(es):
Relevant Pages
|