def test_default_extractor(self): text = "I feel happy this morning." assert_equal(self.classifier.extract_features(text), basic_extractor(text, self.train_set))
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)"])
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)"])