Example #1
0
 def test_score(self):
     self.assertEqual(
         smart_match.score('Web Aplications',
                           'Web Application Development With PHP'), 65)
     self.assertAlmostEqual(smart_match.score('', 'eee'), -3)
     self.assertAlmostEqual(smart_match.score('aaa', 'eee'), 0)
     self.assertAlmostEqual(smart_match.score('Healed', 'Help'), 10)
     self.assertAlmostEqual(smart_match.score('Healed', 'Sold'), 5)
     self.assertAlmostEqual(
         smart_match.score('Web Database Applications',
                           'Web Application Development With PHP'), 62)
     self.assertAlmostEqual(
         smart_match.score(
             'Web Database Applications',
             'WebRAD: Building Database Applications on the Web with Visual FoxPro and Web Connection'
         ), 110)
     self.assertAlmostEqual(
         smart_match.score(
             'Web Database Applications',
             'Structural Assessment: The Role of Large and Full-Scale Testing'
         ), 12)
    def test_score(self):
        self.assertEqual(smart_match.score('test string1', 'test string2'), -1)
        smart_match.set_params(gap=-1, mismatch=-1, match=1)
        self.assertEqual(smart_match.score('GATTACA', 'GCATGCU'), 0)
        self.assertAlmostEqual(smart_match.score('Healed', 'Help'), 0)
        smart_match.set_params(gap=-1, mismatch=-1, match=1)
        self.assertAlmostEqual(
            smart_match.score('Sam J Chapman', 'Samuel John Chapman'), 7)
        self.assertAlmostEqual(smart_match.score('Sam Chapman', 'S Chapman'),
                               7)
        self.assertAlmostEqual(
            smart_match.score('John Smith', 'Samuel John Chapman'), -8)
        self.assertAlmostEqual(smart_match.score('John Smith', 'Sam Chapman'),
                               -9)
        self.assertAlmostEqual(
            smart_match.score('John Smith', 'Sam J Chapman'), -9)
        self.assertAlmostEqual(smart_match.score('John Smith', 'S Chapman'),
                               -7)
        self.assertAlmostEqual(
            smart_match.score('Web Database Applications',
                              'Web Database Applications with PHP & MySQL'), 8)
        self.assertAlmostEqual(
            smart_match.score(
                'Web Database Applications',
                'Building Web Database Applications with Visual Studio 6'), -5)
        self.assertAlmostEqual(
            smart_match.score('Web Database Applications',
                              'Web Application Development With PHP'), -15)

        self.assertAlmostEqual(
            smart_match.score(
                'Web Database Applications',
                'WebRAD: Building Database Applications on the'
                ' Web with Visual FoxPro and Web Connection'), -37)
        self.assertAlmostEqual(
            smart_match.score(
                'Web Database Applications',
                'Structural Assessment: The Role of Large and'
                ' Full-Scale Testing'), -42)
        self.assertAlmostEqual(
            smart_match.score('Web Database Applications',
                              'How to Find a Scholarship Online'), -21)
        self.assertAlmostEqual(
            smart_match.score('Web Aplications',
                              'Web Database Applications with PHP & MySQL'),
            -12)
Example #3
0
 def test_score(self):
     self.assertEqual(smart_match.score('hello', 'low'), 2)
Example #4
0
 def test_score(self):
     self.assertEqual(smart_match.score('hello', 'hill'), 3)
     self.assertEqual(smart_match.score('test string1', 'test string2'), 11)
     self.assertEqual(smart_match.score('test', 'test string2'), 4)
     self.assertEqual(smart_match.score('', 'test string2'), 0)
     self.assertEqual(
         smart_match.score('aaa bbb ccc ddd', 'aaa bbb ccc eee'), 12)
     self.assertEqual(smart_match.score('aaa bbb', 'aaa aaa'), 4)
     self.assertEqual(smart_match.score('aaa', 'aaa aaa'), 3)
     self.assertEqual(smart_match.score('a b c d', 'a b c e'), 6)
     self.assertEqual(smart_match.score('transpose', 'tranpsose'), 8)
     self.assertEqual(smart_match.score('uxyw', 'uyxw'), 3)
     self.assertEqual(smart_match.score('uxaayw', 'uyxw'), 3)
     self.assertEqual(smart_match.score('Healed', 'Sealed'), 5)
     self.assertEqual(smart_match.score('Healed', 'Healthy'), 4)
     self.assertEqual(smart_match.score('Healed', 'Heard'), 4)
     self.assertEqual(smart_match.score('Healed', 'Herded'), 4)
     self.assertEqual(smart_match.score('Healed', 'Help'), 3)
     self.assertEqual(smart_match.score('Healed', 'sold'), 2)
     self.assertEqual(
         smart_match.score('Sam J Chapman', 'Samuel John Chapman'), 13)
     self.assertEqual(smart_match.score('Sam Chapman', 'S Chapman'), 9)
     self.assertEqual(
         smart_match.score('John Smith', 'Samuel John Chapman'), 6)
     self.assertEqual(smart_match.score('John Smith', 'Sam Chapman'), 3)
     self.assertEqual(smart_match.score('John Smith', 'Sam J Chapman'), 3)
     self.assertEqual(smart_match.score('John Smith', 'S Chapman'), 2)
     self.assertEqual(
         smart_match.score('Web Database Applications',
                           'Web Database Applications with PHP & MySQL'),
         25)
     self.assertEqual(
         smart_match.score(
             'Web Database Applications',
             'Creating Database Web Applications with PHP and ASP'), 23)
     self.assertEqual(
         smart_match.score(
             'Web Database Applications',
             'Building Database Applications on the Web Using PHP3'), 22)
     self.assertEqual(
         smart_match.score(
             'Web Database Applications',
             'Building Web Database Applications with Visual Studio 6'), 25)
     self.assertEqual(
         smart_match.score('Web Database Applications',
                           'Web Application Development With PHP'), 15)
     self.assertEqual(
         smart_match.score(
             'Web Database Applications',
             'WebRAD: Building Database Applications on the Web with Visual FoxPro and Web Connection'
         ), 25)
     self.assertEqual(
         smart_match.score(
             'Web Database Applications',
             'Structural Assessment: The Role of Large and Full-Scale Testing'
         ), 11)
     self.assertEqual(
         smart_match.score('Web Database Applications',
                           'How to Find a Scholarship Online'), 9)
     self.assertEqual(
         smart_match.score('Web Aplications',
                           'Web Database Applications with PHP & MySQL'),
         15)
     self.assertEqual(
         smart_match.score(
             'Web Aplications',
             'Creating Database Web Applications with PHP and ASP'), 15)
     self.assertEqual(
         smart_match.score(
             'Web Aplications',
             'Building Database Applications on the Web Using PHP3'), 13)
     self.assertEqual(
         smart_match.score(
             'Web Aplications',
             'Building Web Database Applications with Visual Studio 6'), 15)
     self.assertEqual(
         smart_match.score('Web Aplications',
                           'Web Application Development With PHP'), 14)
     self.assertEqual(
         smart_match.score(
             'Web Aplications',
             'WebRAD: Building Database Applications on the Web with Visual FoxPro and Web Connection'
         ), 15)
     self.assertEqual(
         smart_match.score(
             'Web Aplications',
             'Structural Assessment: The Role of Large and Full-Scale Testing'
         ), 8)
     self.assertEqual(
         smart_match.score('Web Aplications',
                           'How to Find a Scholarship Online'), 6)
 def test_score(self):
     self.assertEqual(
         smart_match.score('Web Aplications',
                           'Web Application Development With PHP'), 65)
Example #6
0
 def test_score(self):
     self.assertEqual(smart_match.score('hello', 'hill'), 3)
 def test_score(self):
     self.assertEqual(smart_match.score('test string1', 'test string2'), -1)
     smart_match.set_params(gap=-1, mismatch=-1, match=1)
     self.assertEqual(smart_match.score('GATTACA', 'GCATGCU'), 0)