def test_tag_ner_str_list_french(self): """Test make_ner(), str, list.""" text_str = """Berte fu mere Charlemaine, qui pukis tint France et tot le Maine.""" ner_replacer = NamedEntityReplacer() tokens = ner_replacer.tag_ner_fr(input_text=text_str, output_type=list) target = [[('Berte', 'entity', 'CHI')], ('fu',), ('mere',), [('Charlemaine', 'entity', 'CHI')], (',',), ('qui',), ('pukis',), ('tint',), [('France', 'entity', 'LOC')], ('et',), ('tot',), ('le',), [('Maine', 'entity', 'LOC')], ('.',)] self.assertEqual(tokens, target)
def test_tag_ner_str_list_french(self): """Test make_ner(), str, list.""" text_str = """Berte fu mere Charlemaine, qui pukis tint France et tot le Maine.""" ner_replacer = NamedEntityReplacer() tokens = ner_replacer.tag_ner_fr(input_text=text_str, output_type=list) target = [[('Berte', 'entity', 'CHI')], ('fu', ), ('mere', ), [('Charlemaine', 'entity', 'CHI')], (',', ), ('qui', ), ('pukis', ), ('tint', ), [('France', 'entity', 'LOC')], ('et', ), ('tot', ), ('le', ), [('Maine', 'entity', 'LOC')], ('.', )] self.assertEqual(tokens, target)
def test_tag_ner_str_list_french(self): """Test make_ner(), str, list.""" text_str = "Berte fu mere Charlemaine, qui pukis tint France et tot le Maine." ner_replacer = NamedEntityReplacer() tokens = ner_replacer.tag_ner_fr(input_text=text_str, output_type=list) target = [ [("Berte", "entity", "CHI")], ("fu", ), ("mere", ), [("Charlemaine", "entity", "CHI")], (",", ), ("qui", ), ("pukis", ), ("tint", ), [("France", "entity", "LOC")], ("et", ), ("tot", ), ("le", ), [("Maine", "entity", "LOC")], (".", ), ] self.assertEqual(tokens, target)