Example #1
0
    def test_parse_simply_text(self):
        text = "A recent decision by a United States Supreme Court in Alabama v. Ballyshear LLC confirms that a key factor is the location of the impact of the alleged discriminatory conduct."
        ret = _get_court_list(text)
        self.assertEqual(1, len(ret))
        self.assertEqual("en", ret[0].locale)

        ret = _get_court_list(text, "z")
        self.assertEqual("z", ret[0].locale)

        items = list(_get_courts(text))
        court_name = items[0]["tags"]["Extracted Entity Court Name"]
        self.assertEqual('United States Supreme Court', court_name)
Example #2
0
    def test_parse_empty_text(self):
        ret = _get_court_list('')
        self.assertEqual(0, len(ret))
        ret = _get_court_list("""

         """)