Пример #1
0
 def test_default_extractor(self):
     text = "I feel happy this morning."
     assert_equal(self.classifier.extract_features(text), basic_extractor(text, self.train_set))
Пример #2
0
 def test_basic_extractor(self):
     text = "I feel happy this morning."
     feats = basic_extractor(text, self.train_set)
     assert_true(feats["contains(feel)"])
     assert_true(feats['contains(morning)'])
     assert_false(feats["contains(amazing)"])
Пример #3
0
 def test_basic_extractor(self):
     text = "I feel happy this morning."
     feats = basic_extractor(text, self.train_set)
     assert_true(feats["contains(feel)"])
     assert_true(feats['contains(morning)'])
     assert_false(feats["contains(amazing)"])
Пример #4
0
 def test_default_extractor(self):
     text = "I feel happy this morning."
     assert_equal(self.classifier.extract_features(text),
                  basic_extractor(text, self.train_set))
Пример #5
0
def test_basic_extractor_with_list():
    text = "I feel happy this morning.".split()
    feats = basic_extractor(text, train_set)
    assert_true(feats["contains(feel)"])
    assert_true(feats['contains(morning)'])
    assert_false(feats["contains(amazing)"])