def test_string_msg(self): """ Test lexicalising a message with "canned text". """ msg = StringMsgSpec('this is some text') res = lexicalise_message_spec(msg) expected = [String('this is some text')] result = list(res.constituents()) self.assertEqual(expected, result)
def test_lexicalise_msg(self): """ Test lexicalisation of Message. """ # a message with 1 nucleus and 2 satellites m = Message('Elaboration', DummyMsg(), DummyMsg(), DummyMsg()) lex = lexicalise_message(m) tmp = list(lexicalise_message_spec(DummyMsg()).constituents()) expected = tmp + tmp + tmp self.assertEqual(expected, list(lex.constituents()))
def test_lexicalise_msg_spec(self): """ Test lexicalisation of MsgSpec. """ msg = DummyMsg() res = lexicalise_message_spec(msg) expected = [String('Boris'), String('is'), String('fast')] self.assertEqual(expected, list(res.constituents()))