コード例 #1
0
ファイル: judgment_tests.py プロジェクト: rgeorgi/intent
    def test_extract_questionable(self):
        l1 = " ?This statement is questionable"
        r1 = "  This statement is questionable"
        l2 = "  This statement is a question?"
        r2 = "  This statement is a question?"

        result, j = extract_judgment(l1)
        self.assertEqual(result, r1)
        self.assertEqual(j, '?')

        result, j = extract_judgment(l2)
        self.assertEqual(result, r2)
        self.assertEqual(j, None)
コード例 #2
0
ファイル: judgment_tests.py プロジェクト: rgeorgi/intent
    def test_extract_none(self):
        l1 = "  This statement is fine"
        r1 = "  This statement is fine"

        result, j = extract_judgment(l1)
        self.assertEqual(result, r1)
        self.assertEqual(j, None)
コード例 #3
0
ファイル: judgment_tests.py プロジェクト: rgeorgi/intent
 def test_extract_ungrammatical(self):
     l1 = "             '*Read many   books, she has'"
     result, j = extract_judgment(l1)
     self.assertEqual(result, "             ' Read many   books, she has'")
     self.assertEqual(j, '*')