MCPcopy Index your code
hub / github.com/clips/pattern / test_conditional

Method test_conditional

test/test_en.py:754–774  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

752 print "pattern.en.modality.imperative()"
753
754 def test_conditional(self):
755 # Assert True for sentences that contain possible or imaginary situations.
756 from pattern.text.en.modality import conditional
757 for b, s in (
758 (True, "We ought to help him."),
759 (True, "We could help him."),
760 (True, "I will help you."),
761 (True, "I hope you will help me."),
762 (True, "I can help you if you let me."),
763 (False, "You will help me."),
764 (False, "I can help you.")):
765 self.assertEqual(conditional(en.Sentence(en.parse(s))), b)
766 # Assert predictive mood.
767 s = "I will help you."
768 v = conditional(en.Sentence(en.parse(s)), predictive=False)
769 self.assertEqual(v, False)
770 # Assert speculative mood.
771 s = "I will help you if you pay me."
772 v = conditional(en.Sentence(en.parse(s)), predictive=False)
773 self.assertEqual(v, True)
774 print "pattern.en.modality.conditional()"
775
776 def test_subjunctive(self):
777 # Assert True for sentences that contain wishes, judgments or opinions.

Callers

nothing calls this directly

Calls 2

conditionalFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected