Fix bug 9975 Incorrect SoundEx result (#388)

This commit is contained in:
Sam Manzi 2017-05-05 16:29:27 +10:00 committed by GitHub
parent 38db06f931
commit 49493290c5

View File

@ -52,6 +52,8 @@ def soundex(strval):
return "Z000" return "Z000"
strval = strval.decode('ASCII', 'ignore') strval = strval.decode('ASCII', 'ignore')
str2 = strval[0] str2 = strval[0]
translator = strval.maketrans('','',IGNORE)
strval = strval.translate(translator)
strval = strval.translate(TABLE) strval = strval.translate(TABLE)
if not strval: if not strval:
return "Z000" return "Z000"