Appendix B ; dict.cl ; sample dictionary for PSYC-526 parser ; extended for CS-471 ; the dictionary is an a-list ; the first item is the list representing the word or words that we are interested in ; the second is a structure defined as: (defstruct lexeme meaning action part agr vform subcat) ; these are based greatly off of Allen from Artificial Intelligence Theory and Practice ; makes a list named dictionary which contains all the lexicons ; initially empty (setq dictionary nil) ; function for adding an item to the dictionary ; key is a list that serves as the alist key ; item is a lexicon item (defun add-dictionary (key item) (push (list key item) dictionary)) ; How is it going (add-dictionary '(how is it going) (make-lexeme :meaning "a question often used as a greeting requesting information as to the subjects state" :action nil :part 'S :agr '(? a) :vform 'present :subcat nil)) ; Don't panic (add-dictionary '(don't panic) (make-lexeme :meaning "a phrase used to indicate that the subject should not be concerned with the current state of events" :action nil :part 'S :agr '(? a) :vform 'present :subcat nil)) ; On a bright sunny day we go to the beach (add-dictionary '(on) (make-lexeme :meaning "a modifier specifing the subject is located above or occurs durring the object" :action nil :part 'Prep :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(bright and sunny day) (make-lexeme :meaning "a day of favorable weather conditions which includes warm temperatures and an abundance of sunlight" :action nil :part 'N :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(we) (make-lexeme :meaning "a group of people including the speaker" :action nil :part 'N :agr '1P :vform nil :subcat nil)) (add-dictionary '(go to the beach) (make-lexeme :meaning "a verb phrase indicating travel to a sandy location near a body of water usually for the purposes of fun and relaxation" :action nil :part 'VP :agr '(? a) :vform 'future :subcat nil)) ; Her long flowing hair swung back and forth (add-dictionary '(her) (make-lexeme :meaning "pronoun refering to female subject" :action nil :part 'Art :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(long flowing hair) (make-lexeme :meaning "proteen strains from a subject's head of above average length and left unconstrained" :action nil :part 'N :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(swung back and forth) (make-lexeme :meaning "action of periodic movement through a given path as in a pendulum" :action nil :part 'VP :agr '(? a) :vform 'past :subcat nil)) ; That man in the red coat is running very fast (add-dictionary '(that) (make-lexeme :meaning "used to indicate what the subject is" :action nil :part 'Art :agr '3S :vform nil :subcat nil)) (add-dictionary '(man) (make-lexeme :meaning "human male" :action nil :part 'N :agr '3S :vform nil :subcat nil)) (add-dictionary '(in) (make-lexeme :meaning "subject is contained within following object" :action nil :part 'Prep :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(red) (make-lexeme :meaning "a color of a relativly long wavelength" :action nil :part 'Adj :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(coat) (make-lexeme :meaning "a piece of outter wear used to protect the subject from cold or precipitation" :action nil :part 'N :agr '3S :vform nil :subcat nil)) (add-dictionary '(is running) (make-lexeme :meaning "the action of traveling very quickly by foot" :action nil :part 'V :agr '3S :vform 'present :subcat nil)) (add-dictionary '(very) (make-lexeme :meaning "emphasis on" :action nil :part 'Prep :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(fast) (make-lexeme :meaning "being done in a quick or swift manner" :action nil :part 'Adv :agr '(? a) :vform nil :subcat nil)) ; Long sentences can be difficult to understand and may not break down easily (add-dictionary '(long sentences) (make-lexeme :meaning "parts of language conveying an entire thought which are of above average length" :action nil :part 'NP :agr '3P :vform nil :subcat nil)) (add-dictionary '(can be) (make-lexeme :meaning "there is the possibility of a state of existance" :action nil :part 'V :agr '(? a) :vform 'perfect :subcat nil)) (add-dictionary '(difficult) (make-lexeme :meaning "hard not easy" :action nil :part 'Adv :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(to understand) (make-lexeme :meaning "the action of knowing the semantic meaning of a piece of information" :action nil :part 'VP :agr '(? a) :vform 'perfect :subcat nil)) (add-dictionary '(and) (make-lexeme :meaning "conjunction connection two or more things" :action nil :part 'Cnj :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(may) (make-lexeme :meaning "expresses that there is a possibility not a certanty" :action nil :part 'Adv :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(not) (make-lexeme :meaning "logically negates the following" :action nil :part 'Art :agr '(? a) :vform nil :subcat nil)) (add-dictionary '(break down) (make-lexeme :meaning "be decomposed into its component parts" :action nil :part 'V :agr '(? a) :vform 'perfect :subcat nil)) (add-dictionary '(easily) (make-lexeme :meaning "able to be done without much effort" :action nil :part 'Adv :agr '(? a) :vform nil :subcat nil))