예제 #1
0
    def segregate_and_react(self):
        if not self.check_if_greeting():
            grammifier = Grammifier(self.words)

            print("Referrer is %s" % grammifier.get_referrer())
            mental_state = grammifier.get_stemmed_mental_state()
            action_type = grammifier.get_action_type()

            strategist = Strategist(strategies)
            strategist.get_strategy_for(mental_state, action_type)
예제 #2
0
    def segregate_and_react(self):
        if not self.check_if_greeting():
            grammifier = Grammifier(self.words)

            print("Referrer is %s" % grammifier.get_referrer())
            mental_state = grammifier.get_stemmed_mental_state()
            action_type = grammifier.get_action_type()

            strategist = Strategist(strategies)
            strategist.get_strategy_for(mental_state, action_type)
예제 #3
0
    def segregate_and_react(self):
        action_controller = ActionController(self.words)

        if not self.check_if_greeting() and not action_controller.check_if_action():
            grammifier = Grammifier(self.words)

            print("Referrer is %s" % grammifier.get_referrer())
            mental_state = grammifier.get_stemmed_mental_state()
            action_type = grammifier.get_action_type()

            strategist = Strategist(strategies)
            strategist.get_strategy_for(mental_state, action_type)

        elif action_controller.check_if_action():
            mode = action_controller.get_mode()
            device = action_controller.get_device()
            strategist = Strategist(strategies)
            strategist.get_strategy_for(mode, device)
예제 #4
0
    def segregate_and_react(self):
        action_controller = ActionController(self.words)

        if not self.check_if_greeting(
        ) and not action_controller.check_if_action():
            grammifier = Grammifier(self.words)

            print("Referrer is %s" % grammifier.get_referrer())
            mental_state = grammifier.get_stemmed_mental_state()
            action_type = grammifier.get_action_type()

            strategist = Strategist(strategies)
            strategist.get_strategy_for(mental_state, action_type)

        elif action_controller.check_if_action():
            mode = action_controller.get_mode()
            device = action_controller.get_device()
            strategist = Strategist(strategies)
            strategist.get_strategy_for(mode, device)
예제 #5
0
class StrategistTestCase(unittest.TestCase):
    def setUp(self):
        self.strategist = Strategist(strategies)

    def tearDown(self):
        del self.strategist

    def test_should_return_list_of_strategies(self):
        expected_list = self.strategist.get_strategy_for("feel", "bored")

        self.assertTrue(isinstance(expected_list[0], PlayMusic))
        self.assertTrue(isinstance(expected_list[1], StartTV))