def test_it_find_second_language_proper_nouns_with_treetagger(self): """ Tests the class method of the KeywordExtractor _find_second_language_proper_nouns_with_treetagger. Passes an Italian sentence to this method and finds proper nouns in it. """ kw_extractor = KeywordExtractor( os.path.join(self.script_folder, "test"), "small-mixed.txt", self.output_folder) kw_extractor._find_second_language_proper_nouns_with_treetagger( 'Bernardo Magnagi viene spesso.', set(['un', 'il'])) self.assertEqual(kw_extractor.tree_taggers_proper_nouns, {'Bernardo', 'Magnagi'})
def test_de_find_second_language_proper_nouns_with_treetagger(self): """ Tests the class method of the KeywordExtractor _find_second_language_proper_nouns_with_treetagger. Passes a German sentence to this method and finds proper nouns in it. """ kw_extractor = KeywordExtractor( os.path.join(self.script_folder, "test"), "small-mixed.txt", self.output_folder) kw_extractor._find_second_language_proper_nouns_with_treetagger( 'Wer ist Schuld am Unfall der beiden Rennfahrer Pascal Wehrlein und Nico Rosberg.', set(['ist', 'am', 'der', 'und'])) self.assertEqual( kw_extractor.tree_taggers_proper_nouns, { 'Pascal', 'Nico', 'Rosberg', 'Unfall', 'Rennfahrer', 'Schuld', 'Wehrlein' })