intficpy/parser.py
def checkExtra(self, verb, verb_form, dobj, iobj):
        """
        Checks for words unaccounted for by verb form

        Returns a list, empty or containing one word strings (extra words)
        """

        accounted = []
        extra = list(self.command.tokens)

        for word in extra:
            if word in english.prepositions or word in english.keywords:

                if word in verb_form:
                    accounted.append(word)
                    continue

                for obj in [dobj, iobj]:
                    if not obj:
                        break
                    noun = obj[-1]
                    if noun in self.game.nouns:
                        for item in self.game.nouns[noun]:
                            if word in item.adjectives:
                                accounted.append(word)
                                break
                        if word in accounted:
                            break

                if (
                    word in ("up", "down", "in", "out")
                    and verb.iscope == "direction"
                    and (
                        (iobj and len(iobj) == 1 and word in iobj)
                        or (dobj and len(dobj) == 1 and word in dobj)
                    )
                ):
                    accounted.append(word)

            elif word in verb_form:
                accounted.append(word)

            elif dobj and word in dobj:
                accounted.append(word)

            elif iobj and word in iobj:
                accounted.append(word)

        for word in accounted:
            if word in extra:
                extra.remove(word)
        return extra

        Checks for words unaccounted for by verb form

        Returns a list, empty or containing one word strings (extra words)
        
Checks for words unaccounted for by verb form
Returns a list, empty or containing one word strings (extra words)
Checks for words unaccounted for by verb form Returns a list empty or containing one word strings ( extra words )
def checkExtra(self, verb, verb_form, dobj, iobj):
        accounted = []
        extra = list(self.command.tokens)
        for word in extra:
            if word in english.prepositions or word in english.keywords:
                if word in verb_form:
                    accounted.append(word)
                    continue
                for obj in [dobj, iobj]:
                    if not obj:
                        break
                    noun = obj[-1]
                    if noun in self.game.nouns:
                        for item in self.game.nouns[noun]:
                            if word in item.adjectives:
                                accounted.append(word)
                                break
                        if word in accounted:
                            break
                if (
                    word in ("up", "down", "in", "out")
                    and verb.iscope == "direction"
                    and (
                        (iobj and len(iobj) == 1 and word in iobj)
                        or (dobj and len(dobj) == 1 and word in dobj)
                    )
                ):
                    accounted.append(word)
            elif word in verb_form:
                accounted.append(word)
            elif dobj and word in dobj:
                accounted.append(word)
            elif iobj and word in iobj:
                accounted.append(word)
        for word in accounted:
            if word in extra:
                extra.remove(word)
        return extra
def checkExtra ( self , verb , verb_form , dobj , iobj ) : accounted = [ ] extra = list ( self . command . tokens ) for word in extra : if word in english . prepositions or word in english . keywords : if word in verb_form : accounted . append ( word ) continue for obj in [ dobj , iobj ] : if not obj : break noun = obj [ - 1 ] if noun in self . game . nouns : for item in self . game . nouns [ noun ] : if word in item . adjectives : accounted . append ( word ) break if word in accounted : break if ( word in ( "up" , "down" , "in" , "out" ) and verb . iscope == "direction" and ( ( iobj and len ( iobj ) == 1 and word in iobj ) or ( dobj and len ( dobj ) == 1 and word in dobj ) ) ) : accounted . append ( word ) elif word in verb_form : accounted . append ( word ) elif dobj and word in dobj : accounted . append ( word ) elif iobj and word in iobj : accounted . append ( word ) for word in accounted : if word in extra : extra . remove ( word ) return extra
Checks for words unaccounted for by verb form
Returns a list, empty or containing one word strings (extra words)
Checks for words unaccounted for by verb form Returns a list empty or containing one word strings ( extra words )
"""
        Checks for words unaccounted for by verb form

        Returns a list, empty or containing one word strings (extra words)
        """
self
verb
verb_form
dobj
iobj