Example #1
0
    def test_normalizer_with_pc_conf_under_70(self):
        date_result = ParseResult('Date', None, 10)
        pc_result = ParseResult('Postal Code', None, 40)

        results = DateWithPostalCode.normalize([date_result, pc_result])

        count = 0
        for res in results:
            if res.type == 'Date':
                count += 1
                self.assertEqual(res.confidence, 44)
            elif res.type == "Postal Code":
                count += 1

        self.assertEqual(count, len(results))
Example #2
0
    def test_normalizer_with_pc_conf_under_70(self):
        date_result = ParseResult('Date', None, 10)
        pc_result = ParseResult('Postal Code', None, 40)

        results = DateWithPostalCode.normalize([date_result, pc_result])

        count = 0
        for res in results:
            if res.type == 'Date':
                count += 1
                self.assertEqual(res.confidence, 44)
            elif res.type == "Postal Code":
                count += 1

        self.assertEqual(count, len(results))
Example #3
0
 def test_test(self):
     self.assertFalse(DateWithPostalCode.test(['Date', 'Number'], []))
     self.assertTrue(DateWithPostalCode.test(['Date', 'Postal Code'], []))
Example #4
0
 def test_test(self):
     self.assertFalse(DateWithPostalCode.test(['Date', 'Number'], []))
     self.assertTrue(DateWithPostalCode.test(['Date', 'Postal Code'], []))