def soundex(name, len=<NUM_LIT:4>):
<EOL>soundex_digits = '<STR_LIT>'<EOL>sndx = '<STR_LIT>'<EOL>fc = '<STR_LIT>'<EOL>for c in name.upper():<EOL><INDENT>if c.isalpha():<EOL><INDENT>if not fc: fc = c   <EOL>d = soundex_digits[ord(c)-ord('<STR_LIT:A>')]<EOL>if not sndx or (d != sndx[-<NUM_LIT:1>]):<EOL><INDENT>sndx += d<EOL><DEDENT><DEDENT><DEDENT>sndx = fc + sndx[<NUM_LIT:1>:]<EOL>sndx = sndx.replace('<STR_LIT:0>', '<STR_LIT>')<EOL>return (sndx + (len * '<STR_LIT:0>'))[:len]<EOL>
soundex module conforming to Odell-Russell algorithm