# Path: semantics/lexical_constants.py
# SEARCH_ACTION = "search"
# 
# GO_ACTION = "go"
# 
# GET_ACTION = "retrieve"
# 
# FOLLOW_ACTION = "follow"
# 
# SEE_ACTION = "see"
# 
# TELL_ACTION = "tell"
# 
# ACTION_ALIASES = {
#                   'appear': GO_ACTION,
#                   'get': GET_ACTION,
#                   'obtain': GET_ACTION,
#                   'meander': GO_ACTION,
#                   'slide': GO_ACTION,
#                   'nonvehicle': GO_ACTION,
#                   'escape': GO_ACTION,
#                   'rummage': SEARCH_ACTION,
#                   'characterize': SEE_ACTION,
#                   'chase': FOLLOW_ACTION,
#                   'lodge': STAY_ACTION,
#                   SEARCH_ACTION: SEARCH_ACTION,
#                   GO_ACTION: GO_ACTION,
#                   GET_ACTION: GET_ACTION,
#                   FOLLOW_ACTION: FOLLOW_ACTION,
#                   SEE_ACTION: SEE_ACTION,
#                   TELL_ACTION: TELL_ACTION,
#                   BEGIN_ACTION: BEGIN_ACTION,
#                   ACTIVATE_ACTION: ACTIVATE_ACTION,
#                   DEACTIVATE_ACTION: DEACTIVATE_ACTION,
#                   AVOID_ACTION: AVOID_ACTION,
#                   PATROL_ACTION: PATROL_ACTION,
#                   CARRY_ACTION: CARRY_ACTION,
#                   STAY_ACTION: STAY_ACTION,
#                   DEFUSE_ACTION: DEFUSE_ACTION,
#                  }


import re
from threading import Lock
from semantics.lexical_constants import (SEARCH_ACTION, GO_ACTION, GET_ACTION, FOLLOW_ACTION, 
                                 SEE_ACTION, TELL_ACTION, ACTION_ALIASES)
from ltlbroom.fsa import Automaton
from ltlbroom.ltlgeneration import LTLGenerator, FOLLOW_PROP, SEARCH_PROP, EXPLORE_PROP, UnrealizableError
from nlproxy import send_ltl_commands
from worldmap import get_adjacent_rooms, adjacency_changed
from subtle_msgs.msg import Fiducial
            return

        response = ("I'm now going to %s the %s in the %s." % (action, target, self.location) 
                    if target else  "I'm now going to %s in the %s." % (action, self.location))
        if self.nlmaster:
            self.nlmaster.send_response(response)
        else:
            print response

    def notify_done(self):
        """Notify the commander that we're done."""
        response = "I'm done and I'm in the %s." % self.location
        if self.nlmaster:
            self.nlmaster.send_response(response)
        else:
            print response


def make_response(new_commands):
    """Make a response based on the new commands."""
    # Give up if there were no new commands
    if not new_commands:
        return MISUNDERSTAND

    # Split into good and bad commands, further filtering the good ones
    good_commands = []
    bad_commands = []
    bad_targets = []
    for verb, target in new_commands:
        # Skip the SEE_ACTION entirely

# Path: semantics/lexical_constants.py
# SEARCH_ACTION = "search"
# 
# GO_ACTION = "go"
# 
# GET_ACTION = "retrieve"
# 
# FOLLOW_ACTION = "follow"
# 
# SEE_ACTION = "see"
# 
# TELL_ACTION = "tell"
# 
# ACTION_ALIASES = {
#                   'appear': GO_ACTION,
#                   'get': GET_ACTION,
#                   'obtain': GET_ACTION,
#                   'meander': GO_ACTION,
#                   'slide': GO_ACTION,
#                   'nonvehicle': GO_ACTION,
#                   'escape': GO_ACTION,
#                   'rummage': SEARCH_ACTION,
#                   'characterize': SEE_ACTION,
#                   'chase': FOLLOW_ACTION,
#                   'lodge': STAY_ACTION,
#                   SEARCH_ACTION: SEARCH_ACTION,
#                   GO_ACTION: GO_ACTION,
#                   GET_ACTION: GET_ACTION,
#                   FOLLOW_ACTION: FOLLOW_ACTION,
#                   SEE_ACTION: SEE_ACTION,
#                   TELL_ACTION: TELL_ACTION,
#                   BEGIN_ACTION: BEGIN_ACTION,
#                   ACTIVATE_ACTION: ACTIVATE_ACTION,
#                   DEACTIVATE_ACTION: DEACTIVATE_ACTION,
#                   AVOID_ACTION: AVOID_ACTION,
#                   PATROL_ACTION: PATROL_ACTION,
#                   CARRY_ACTION: CARRY_ACTION,
#                   STAY_ACTION: STAY_ACTION,
#                   DEFUSE_ACTION: DEFUSE_ACTION,
#                  }


# Path: jr/statemanager.py
import re
from threading import Lock
from semantics.lexical_constants import (SEARCH_ACTION, GO_ACTION, GET_ACTION, FOLLOW_ACTION, 
                                 SEE_ACTION, TELL_ACTION, ACTION_ALIASES)
from ltlbroom.fsa import Automaton
from ltlbroom.ltlgeneration import LTLGenerator, FOLLOW_PROP, SEARCH_PROP, EXPLORE_PROP, UnrealizableError
from nlproxy import send_ltl_commands
from worldmap import get_adjacent_rooms, adjacency_changed
from subtle_msgs.msg import Fiducial

            return

        response = ("I'm now going to %s the %s in the %s." % (action, target, self.location) 
                    if target else  "I'm now going to %s in the %s." % (action, self.location))
        if self.nlmaster:
            self.nlmaster.send_response(response)
        else:
            print response

    def notify_done(self):
        """Notify the commander that we're done."""
        response = "I'm done and I'm in the %s." % self.location
        if self.nlmaster:
            self.nlmaster.send_response(response)
        else:
            print response


def make_response(new_commands):
    """Make a response based on the new commands."""
    # Give up if there were no new commands
    if not new_commands:
        return MISUNDERSTAND

    # Split into good and bad commands, further filtering the good ones
    good_commands = []
    bad_commands = []
    bad_targets = []
    for verb, target in new_commands:
        # Skip the SEE_ACTION entirely

        if verb == SEE_ACTION or (verb in ACTION_ALIASES and ACTION_ALIASES[verb] == SEE_ACTION):