Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_phonetic_algorithms = [{
'name': 'Soundex',
'callback': jellyfish.soundex,
'argument_names': ['soundex']
}, {
'name': 'NYSIIS',
'callback': jellyfish.nysiis,
'argument_names': ['nysiis', 'nyssis']
}, {
'name': 'Metaphone',
'callback': jellyfish.metaphone,
'argument_names': ['metaphone']
}, {
'name': 'Match Rating',
'callback': jellyfish.match_rating_codex,
'argument_names': ['match_rating', 'match rating', 'matchrating',
'match_rating_codex', 'matchratingcodex']
}
]
def _list_phonetic_algorithms():
"""Return list of available phonetic algorithms."""
return [alg['argument_names'][0] for alg in _phonetic_algorithms]
def phonetic(s, method, concat=True, encoding='utf-8', decode_error='strict'):
"""Convert names or strings into phonetic codes.
The implemented algorithms are `soundex