Skip to content

Commit

Permalink
Add test cases for tags so we can catch any issues like Issue #42
Browse files Browse the repository at this point in the history
  • Loading branch information
snadi committed Oct 7, 2019
1 parent ab75452 commit d1fee80
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ def setUpClass(cls):
load_tags()
init_corenlp()

def test_tags_in_cond(self):

#should NOT be tagged as a conditional insight
paragraph = "You can add more value types in the toDictionary function if you need."

cond_sentences, processed_sentences, failed_sentences = get_cond_sentences_from_para(paragraph, None, None, None)
for cond_sentence in cond_sentences:
self.assertFalse(cond_sentence.has_so_tag())

def test_tags_in_cond2(self):

#should be tagged as a conditional insight
paragraph = "You can add more value types if you need toDictionary."

cond_sentences, processed_sentences, failed_sentences = get_cond_sentences_from_para(paragraph, None, None, None)
for cond_sentence in cond_sentences:
self.assertTrue(cond_sentence.has_so_tag())

def test_verb_no_dep(self):

#should NOT be tagged as a conditional insight
Expand All @@ -18,7 +36,6 @@ def test_verb_no_dep(self):

cond_sentences, processed_sentences, failed_sentences = get_cond_sentences_from_para(paragraph, None, None, None)
for cond_sentence in cond_sentences:
cond_sentence.print("|")
self.assertFalse(cond_sentence.has_valid_vb_dep())

def test_verb_noun_dep(self):
Expand Down

0 comments on commit d1fee80

Please sign in to comment.