intficpy/parser.py
def matchPrepKeywords(self):
        """
        Check for prepositions in the self.tokenized player command, and remove any candidate
        verbs whose preposition does not match
        Returns a list of Verb objects or an empty list
        """
        remove_verb = []
        for p in english.prepositions:
            if p in self.command.tokens and len(self.command.tokens) > 1:
                exempt = False
                for verb in self.command.verb_matches:
                    ix = self.command.tokens.index(p) + 1
                    if ix < len(self.command.tokens):
                        noun = self.command.tokens[ix]
                        while not noun in self.game.nouns:
                            ix = ix + 1
                            if ix >= len(self.command.tokens):
                                break
                            noun = self.command.tokens[ix]
                        if noun in self.game.nouns:
                            for item in self.game.nouns[noun]:
                                if p in item.adjectives:
                                    exempt = True
                    if p in ["up", "down", "in", "out"]:
                        if verb.iscope == "direction" or verb.dscope == "direction":
                            exempt = True
                    if (
                        not (verb.preposition or not p in verb.preposition)
                        and not exempt
                    ):
                        remove_verb.append(verb)
        for p in english.keywords:
            if p in self.command.tokens and len(self.command.tokens) > 1:
                exempt = False
                for verb in self.command.verb_matches:
                    ix = self.command.tokens.index(p) + 1
                    if ix < len(self.command.tokens):
                        noun = self.command.tokens[ix]
                        while not noun in self.game.nouns:
                            ix = ix + 1
                            if ix >= len(self.command.tokens):
                                break
                            noun = self.command.tokens[ix]
                        if noun in self.game.nouns:
                            for item in self.game.nouns[noun]:
                                if p in item.adjectives:
                                    exempt = True
                    if not (verb.keywords or not p in verb.keywords) and not exempt:
                        remove_verb.append(verb)
        for verb in remove_verb:
            if verb in self.command.verb_matches:
                self.command.verb_matches.remove(verb)

        Check for prepositions in the self.tokenized player command, and remove any candidate
        verbs whose preposition does not match
        Returns a list of Verb objects or an empty list
        
Check for prepositions in the self.tokenized player command, and remove any candidate
verbs whose preposition does not match
Returns a list of Verb objects or an empty list
Check for prepositions in the self . tokenized player command and remove any candidate verbs whose preposition does not match Returns a list of Verb objects or an empty list
def matchPrepKeywords(self):
        remove_verb = []
        for p in english.prepositions:
            if p in self.command.tokens and len(self.command.tokens) > 1:
                exempt = False
                for verb in self.command.verb_matches:
                    ix = self.command.tokens.index(p) + 1
                    if ix < len(self.command.tokens):
                        noun = self.command.tokens[ix]
                        while not noun in self.game.nouns:
                            ix = ix + 1
                            if ix >= len(self.command.tokens):
                                break
                            noun = self.command.tokens[ix]
                        if noun in self.game.nouns:
                            for item in self.game.nouns[noun]:
                                if p in item.adjectives:
                                    exempt = True
                    if p in ["up", "down", "in", "out"]:
                        if verb.iscope == "direction" or verb.dscope == "direction":
                            exempt = True
                    if (
                        not (verb.preposition or not p in verb.preposition)
                        and not exempt
                    ):
                        remove_verb.append(verb)
        for p in english.keywords:
            if p in self.command.tokens and len(self.command.tokens) > 1:
                exempt = False
                for verb in self.command.verb_matches:
                    ix = self.command.tokens.index(p) + 1
                    if ix < len(self.command.tokens):
                        noun = self.command.tokens[ix]
                        while not noun in self.game.nouns:
                            ix = ix + 1
                            if ix >= len(self.command.tokens):
                                break
                            noun = self.command.tokens[ix]
                        if noun in self.game.nouns:
                            for item in self.game.nouns[noun]:
                                if p in item.adjectives:
                                    exempt = True
                    if not (verb.keywords or not p in verb.keywords) and not exempt:
                        remove_verb.append(verb)
        for verb in remove_verb:
            if verb in self.command.verb_matches:
                self.command.verb_matches.remove(verb)
def matchPrepKeywords ( self ) : remove_verb = [ ] for p in english . prepositions : if p in self . command . tokens and len ( self . command . tokens ) > 1 : exempt = False for verb in self . command . verb_matches : ix = self . command . tokens . index ( p ) + 1 if ix < len ( self . command . tokens ) : noun = self . command . tokens [ ix ] while not noun in self . game . nouns : ix = ix + 1 if ix >= len ( self . command . tokens ) : break noun = self . command . tokens [ ix ] if noun in self . game . nouns : for item in self . game . nouns [ noun ] : if p in item . adjectives : exempt = True if p in [ "up" , "down" , "in" , "out" ] : if verb . iscope == "direction" or verb . dscope == "direction" : exempt = True if ( not ( verb . preposition or not p in verb . preposition ) and not exempt ) : remove_verb . append ( verb ) for p in english . keywords : if p in self . command . tokens and len ( self . command . tokens ) > 1 : exempt = False for verb in self . command . verb_matches : ix = self . command . tokens . index ( p ) + 1 if ix < len ( self . command . tokens ) : noun = self . command . tokens [ ix ] while not noun in self . game . nouns : ix = ix + 1 if ix >= len ( self . command . tokens ) : break noun = self . command . tokens [ ix ] if noun in self . game . nouns : for item in self . game . nouns [ noun ] : if p in item . adjectives : exempt = True if not ( verb . keywords or not p in verb . keywords ) and not exempt : remove_verb . append ( verb ) for verb in remove_verb : if verb in self . command . verb_matches : self . command . verb_matches . remove ( verb )
Check for prepositions in the self.tokenized player command, and remove any candidate
verbs whose preposition does not match
Returns a list of Verb objects or an empty list
Check for prepositions in the self . tokenized player command and remove any candidate verbs whose preposition does not match Returns a list of Verb objects or an empty list
"""
        Check for prepositions in the self.tokenized player command, and remove any candidate
        verbs whose preposition does not match
        Returns a list of Verb objects or an empty list
        """
self