예제 #1
0
 def test_trimmable_chars(self):
     """Whitespace should be removed in front and after the name"""
     self.assertEqual(fuzzycomp.cologne_phonetic("\t\n  Breschnew \t\n  "), "17863")
예제 #2
0
 def test_non_encodable_chars(self):
     """Non-encodable chars should be ignored"""
     self.assertEqual(fuzzycomp.cologne_phonetic("Müller-Lüdenscheidt"), "65752682")
예제 #3
0
 def test_umlauts(self):
     """Umlauts should be ignored"""
     self.assertEqual(fuzzycomp.cologne_phonetic("Müller-Lüdenscheidt"), "65752682")
예제 #4
0
 def test_case(self):
     """Function should be case insensitive"""
     self.assertEqual(fuzzycomp.cologne_phonetic("breschnew"), fuzzycomp.cologne_phonetic("BRESCHNEW"))
예제 #5
0
 def test_non_encodable_strings(self):
     """Function should return an empty string if it can not be encoded"""
     self.assertEqual(fuzzycomp.cologne_phonetic("!%&)#=&#"), "")
예제 #6
0
 def test_valid_input(self):
     """Function should return valid results under valid input"""
     for name in self.names:
         self.assertEqual(fuzzycomp.cologne_phonetic(name[0]), name[1])
예제 #7
0
 def test_unicode(self):
     """Function should work properly with Unicode data"""
     for name in self.names:
         self.assertEqual(fuzzycomp.cologne_phonetic(unicode(name[0])), name[1])
예제 #8
0
 def test_umlauts(self):
     """Umlauts should be ignored"""
     self.assertEqual(fuzzycomp.cologne_phonetic("Müller-Lüdenscheidt"),
                      "65752682")
예제 #9
0
 def test_trimmable_chars(self):
     """Whitespace should be removed in front and after the name"""
     self.assertEqual(fuzzycomp.cologne_phonetic("\t\n  Breschnew \t\n  "),
                      "17863")
예제 #10
0
 def test_non_encodable_chars(self):
     """Non-encodable chars should be ignored"""
     self.assertEqual(fuzzycomp.cologne_phonetic("Müller-Lüdenscheidt"),
                      "65752682")
예제 #11
0
 def test_non_encodable_strings(self):
     """Function should return an empty string if it can not be encoded"""
     self.assertEqual(fuzzycomp.cologne_phonetic("!%&)#=&#"), "")
예제 #12
0
 def test_case(self):
     """Function should be case insensitive"""
     self.assertEqual(fuzzycomp.cologne_phonetic("breschnew"),
                      fuzzycomp.cologne_phonetic("BRESCHNEW"))
예제 #13
0
 def test_unicode(self):
     """Function should work properly with Unicode data"""
     for name in self.names:
         self.assertEqual(fuzzycomp.cologne_phonetic(unicode(name[0])),
                          name[1])
예제 #14
0
 def test_valid_input(self):
     """Function should return valid results under valid input"""
     for name in self.names:
         self.assertEqual(fuzzycomp.cologne_phonetic(name[0]), name[1])