Skip to content

Instantly share code, notes, and snippets.

@talfco
Last active February 27, 2019 20:43
Show Gist options
  • Save talfco/a4c1300045628fa63bfc9d587130f05a to your computer and use it in GitHub Desktop.
Save talfco/a4c1300045628fa63bfc9d587130f05a to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import pytest
from name_matching import double_metaphone,double_metaphone_compare, Threshold
class TestClass(object):
def test_double_metaphone(self):
tp1 = double_metaphone(u'LilianeMauryPasquier')
tp2 = double_metaphone(u'liliane Maury Pasquier')
assert True == double_metaphone_compare(tp1,tp2,Threshold.STRONG)
tp1 = double_metaphone(u'L. Maury Pasquier')
tp2 = double_metaphone(u'liliane Maury Pasquier')
assert False == double_metaphone_compare(tp1,tp2,Threshold.STRONG)
tp1 = double_metaphone(u'Marta Flückiger-Bäni')
tp2 = double_metaphone(u'Marta Fluckiger-Bani')
assert True == double_metaphone_compare(tp1,tp2,Threshold.STRONG)
tp1 = double_metaphone(u'Marta Flückiger-Bäni')
tp2 = double_metaphone(u'Marta Flükger-Bäni')
assert True == double_metaphone_compare(tp1,tp2,Threshold.NORMAL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment