示例#1
0
    def test_discriminate1(self):
        """ Color discriminant should be found"""

        logger.info(
            "\n##################### test_discriminate1 ########################\n"
        )
        ####
        stmt = "the banana is good"
        answer = "the green one"
        ####
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        expected_result = ['green_banana hasFeature good']
        self.assertTrue(check_results(res[0], expected_result))
        """ Color discriminant should be found"""

        logger.info(
            "\n##################### test_discriminate2 ########################\n"
        )
        ####
        stmt = "the banana is good"
        answer = "the yellow one"
        ####
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        expected_result = ['y_banana hasFeature good']
        self.assertTrue(check_results(res[0], expected_result))
    def test_descr_generation_01(self):
        logger.info("\nDescription Generation - Test1: Generate unambiguous description")
        objectID = 'BLUE_BOTTLE'
        expected_result = (True, ['?obj rdf:type Bottle', '?obj * blue'])
        res = self.disc.find_unambiguous_desc(objectID)

        logger.info("Result of desc generation: " + str(res))

        self.assertEquals(res[0], expected_result[0])
        self.assertTrue(check_results(res[1], expected_result[1], allow_question_mark=True))
    def test_descr_generation_03(self):
        logger.info("\nDescription Generation - Test3: Generate unambiguous description")
        objectID = 'SPACENAVBOX'
        expected_result = (True, ['?obj rdf:type Gamebox', '?obj * white', '?obj isOn ACCESSKIT'])
        res = self.disc.find_unambiguous_desc(objectID)

        logger.info("Result of desc generation: " + str(res))

        self.assertEquals(res[0], expected_result[0])
        self.assertTrue(check_results(res[1], expected_result[1], allow_question_mark=True))
示例#4
0
    def test_descr_generation_02(self):
        logger.info("\nDescription Generation - Test2: Generate unambiguous description")
        objectID = "ACCESSKIT"
        expected_result = (True, ["?obj rdf:type Gamebox", "?obj isOn table1"])
        res = self.disc.find_unambiguous_desc(objectID)

        logger.info("Result of desc generation: " + str(res))

        self.assertEquals(res[0], expected_result[0])
        self.assertTrue(check_results(res[1], expected_result[1], allow_question_mark=True))
 def test_discriminate9(self):
     logger.info("\n##################### Class grounding ########################\n")
     ####
     stmt = "a fruit is a plant"
     answer = "a kind of thing"
     ####
     expected_result = ['Plant rdfs:subClassOf Thing', 'Fruit rdfs:subClassOf Plant']
     ###
     res = self.dialog.test('myself', stmt, answer)
     logger.info(res)
     self.assertTrue(check_results(res[0], expected_result))
示例#6
0
    def test_discriminate7(self):
        """ Location discriminant should be found """

        logger.info("\n##################### test_discriminate7 ########################\n")
        ####
        stmt = "get the white gamebox"
        answer = "the one which is on the table1"
        ####
        expected_result = ["myself desires *", "* rdf:type Get", "* performedBy myself", "* actsOnObject ACCESSKIT"]
        ###
        res = self.dialog.test("myself", stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#7
0
    def test_discriminate6(self):
        """No complete discriminant found. More info required"""

        logger.info("\n##################### test_discriminate6 ########################\n")
        ####
        stmt = "get the big gamebox"
        answer = "the orange one"
        ####
        expected_result = ["myself desires *", "* rdf:type Get", "* performedBy myself", "* actsOnObject ORANGEBOX"]
        ###
        res = self.dialog.test("myself", stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#8
0
    def test_discriminate4(self):
        """No ambiguity."""

        logger.info("\n##################### test_discriminate4 ########################\n")
        ####
        stmt = "get the gamebox which is on the table"
        answer = None
        ####
        expected_result = ["myself desires *", "* rdf:type Get", "* performedBy myself", "* actsOnObject ACCESSKIT"]
        ###
        res = self.dialog.test("myself", stmt)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#9
0
    def test_discriminate8(self):
        """ Location wrt robot discriminant should be found """

        logger.info("\n##################### test_discriminate8 ########################\n")
        ####
        stmt = "get the bottle"
        answer = "the one which is in front of you"
        ####
        expected_result = ["myself desires *", "* rdf:type Get", "* performedBy myself", "* actsOnObject r_bottle"]
        ###
        res = self.dialog.test("myself", stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#10
0
    def test_descr_generation_02(self):
        logger.info(
            "\nDescription Generation - Test2: Generate unambiguous description"
        )
        objectID = 'ACCESSKIT'
        expected_result = (True, ['?obj rdf:type Gamebox', '?obj isOn table1'])
        res = self.disc.find_unambiguous_desc(objectID)

        logger.info("Result of desc generation: " + str(res))

        self.assertEquals(res[0], expected_result[0])
        self.assertTrue(
            check_results(res[1], expected_result[1],
                          allow_question_mark=True))
示例#11
0
    def test_descr_generation_01(self):
        logger.info(
            "\nDescription Generation - Test1: Generate unambiguous description"
        )
        objectID = 'BLUE_BOTTLE'
        expected_result = (True, ['?obj rdf:type Bottle', '?obj * blue'])
        res = self.disc.find_unambiguous_desc(objectID)

        logger.info("Result of desc generation: " + str(res))

        self.assertEquals(res[0], expected_result[0])
        self.assertTrue(
            check_results(res[1], expected_result[1],
                          allow_question_mark=True))
    def test_discriminate1(self):
        """ Color discriminant should be found"""

        logger.info("\n##################### test_discriminate1 ########################\n")
        ####
        stmt = "the banana is good"
        answer = "the green one"
        ####
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        expected_result = ['green_banana hasFeature good']
        self.assertTrue(check_results(res[0], expected_result))

        """ Color discriminant should be found"""

        logger.info("\n##################### test_discriminate2 ########################\n")
        ####
        stmt = "the banana is good"
        answer = "the yellow one"
        ####
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        expected_result = ['y_banana hasFeature good']
        self.assertTrue(check_results(res[0], expected_result))
示例#13
0
 def test_discriminate9(self):
     logger.info(
         "\n##################### Class grounding ########################\n"
     )
     ####
     stmt = "a fruit is a plant"
     answer = "a kind of thing"
     ####
     expected_result = [
         'Plant rdfs:subClassOf Thing', 'Fruit rdfs:subClassOf Plant'
     ]
     ###
     res = self.dialog.test('myself', stmt, answer)
     logger.info(res)
     self.assertTrue(check_results(res[0], expected_result))
    def test_discriminate5(self):
        """ Size discriminant should be found """

        logger.info("\n##################### test_discriminate5 ########################\n")
        ####
        stmt = "get the orange gamebox"
        answer = "the big one"
        ####
        expected_result = ['myself desires *',
                           '* rdf:type Get',
                           '* performedBy myself',
                           '* actsOnObject ORANGEBOX']
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
    def test_discriminate3(self):
        """ Color discriminant should be found"""

        logger.info("\n##################### test_discriminate3 ########################\n")
        ####
        stmt = "give me the banana"
        answer = "the green one"
        ####
        expected_result = ['myself desires *',
                           '* rdf:type Give',
                           '* performedBy myself',
                           '* actsOnObject green_banana',
                           '* receivedBy myself']
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#16
0
    def test_discriminate6(self):
        """No complete discriminant found. More info required"""

        logger.info(
            "\n##################### test_discriminate6 ########################\n"
        )
        ####
        stmt = "get the big gamebox"
        answer = "the orange one"
        ####
        expected_result = [
            'myself desires *', '* rdf:type Get', '* performedBy myself',
            '* actsOnObject ORANGEBOX'
        ]
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#17
0
    def test_discriminate8(self):
        """ Location wrt robot discriminant should be found """

        logger.info(
            "\n##################### test_discriminate8 ########################\n"
        )
        ####
        stmt = "get the bottle"
        answer = "the one which is in front of you"
        ####
        expected_result = [
            'myself desires *', '* rdf:type Get', '* performedBy myself',
            '* actsOnObject r_bottle'
        ]
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#18
0
    def test_discriminate7(self):
        """ Location discriminant should be found """

        logger.info(
            "\n##################### test_discriminate7 ########################\n"
        )
        ####
        stmt = "get the white gamebox"
        answer = "the one which is on the table1"
        ####
        expected_result = [
            'myself desires *', '* rdf:type Get', '* performedBy myself',
            '* actsOnObject ACCESSKIT'
        ]
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#19
0
    def test_discriminate4(self):
        """No ambiguity."""

        logger.info(
            "\n##################### test_discriminate4 ########################\n"
        )
        ####
        stmt = "get the gamebox which is on the table"
        answer = None
        ####
        expected_result = [
            'myself desires *', '* rdf:type Get', '* performedBy myself',
            '* actsOnObject ACCESSKIT'
        ]
        ###
        res = self.dialog.test('myself', stmt)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))
示例#20
0
    def test_discriminate3(self):
        """ Color discriminant should be found"""

        logger.info(
            "\n##################### test_discriminate3 ########################\n"
        )
        ####
        stmt = "give me the banana"
        answer = "the green one"
        ####
        expected_result = [
            'myself desires *', '* rdf:type Give', '* performedBy myself',
            '* actsOnObject green_banana', '* receivedBy myself'
        ]
        ###
        res = self.dialog.test('myself', stmt, answer)
        logger.info(res)
        self.assertTrue(check_results(res[0], expected_result))