Exemplo n.º 1
0
 def test_verbs_sentence_3_stanford(self):
     """
     Test function to test the verbs identification in sentence_3
     """
     pos_tagger = POS_tagger(STANFORD_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_3))
     returned_tags = pos_tagger.detect_verbs(all_tags)
     expected_tags = [u'viven', u'van']
     self.assertEqual(set(returned_tags), set(expected_tags))
Exemplo n.º 2
0
 def test_adjectives_sentence_2_stanford(self):
     """
     Test function to test the adjectives identification in sentence_2
     """
     pos_tagger = POS_tagger(STANFORD_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_2))
     returned_tags = pos_tagger.detect_adjectives(all_tags)
     expected_tags = [u'fuerte', u'rápido']
     self.assertEqual(set(returned_tags), set(expected_tags))
Exemplo n.º 3
0
 def test_nouns_sentence_1_stanford(self):
     """
     Test function to test the nouns identification in sentence_1
     """
     pos_tagger = POS_tagger(STANFORD_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_1))
     returned_tags = pos_tagger.detect_nouns(all_tags)
     expected_tags = [u'prueba']
     self.assertEqual(set(returned_tags), set(expected_tags))
Exemplo n.º 4
0
 def test_adjectives_sentence_3_nltk(self):
     """
     Test function to test the adjectives identification in sentence_3
     """
     pos_tagger = POS_tagger(NLTK_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_3))
     returned_tags = pos_tagger.detect_adjectives(all_tags)
     expected_tags = []
     self.assertEqual(set(returned_tags), set(expected_tags))
Exemplo n.º 5
0
 def test_nouns_sentence_3_nltk(self):
     """
     Test function to test the nouns identification in sentence_3
     """
     pos_tagger = POS_tagger(NLTK_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_3))
     returned_tags = pos_tagger.detect_nouns(all_tags)
     expected_tags = [u'amigos', u'playa', u'vacaciones', u'montaña']
     self.assertEqual(set(returned_tags), set(expected_tags))
Exemplo n.º 6
0
 def test_nouns_sentence_2_nltk(self):
     """
     Test function to test the nouns identification in sentence_2
     """
     pos_tagger = POS_tagger(NLTK_TAGGER_NAME)
     all_tags = pos_tagger.get_tags(word_tokenize(self.sentence_2))
     returned_tags = pos_tagger.detect_nouns(all_tags)
     expected_tags = [u'Juan']
     self.assertEqual(set(returned_tags), set(expected_tags))