How to use the jellyfish.match_rating_codex function in jellyfish

To help you get started, we’ve selected a few jellyfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github J535D165 / recordlinkage / recordlinkage / preprocessing / encoding.py View on Github external
_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