コード例 #1
0
ファイル: test_scanner.py プロジェクト: shaikidris/piicatcher
class NERTests(TestCase):
    def setUp(self):
        self.parser = NERScanner()

    def test_person(self):
        types = self.parser.scan("Jonathan is in the office")
        self.assertTrue(PiiTypes.PERSON in types)

    def test_location(self):
        types = self.parser.scan("Jonathan is in Bangalore")
        self.assertTrue(PiiTypes.LOCATION in types)
コード例 #2
0
class NERTests(TestCase):
    def setUp(self):
        self.parser = NERScanner()

    def test_person(self):
        types = self.parser.scan("Roger is in the office")
        self.assertTrue(PiiTypes.PERSON in types)

    def test_location(self):
        types = self.parser.scan("Jonathan is in Bangalore")
        self.assertTrue(PiiTypes.LOCATION in types)

    def test_date(self):
        types = self.parser.scan("Jan 1 2016 is a new year")
        self.assertTrue(PiiTypes.BIRTH_DATE in types)