Write a function PARTOFSPEECH in Lisp that takes 6 parameters.
Parameter 1 is a list of English nouns.
Parameter 2 is a list of English verbs.
Parameter 3 is a list of English articles.
Parameter 4 is a list of English prepositions.
Parameter 5 is a list of English adverbs.
Parameter 6 is a list of lists, each of which is an English sentence.
The function PARTOFSPEECH returns a list of lists corresponding to
parameter 6,
but PARTOFSPEECH replaces every word in every sentence with just the name
of
its part of speech, that is, noun, verb, article, preposition, or adverb.
If a word appears in an English sentence that is not mentioned in any of the
first five parameters, replace it with the word "unknown".
gcl in the CSLab or Multilab.
three.lisp, containing
your Lisp program. Then start Lisp, and type
(REQUIRE "three.lisp")to have the interpreter read in your file and then interact with you further. You will want to evaluate
(QUIT) to exit the interactive session.
SETQ, RPLACA, or RPLACD.
You are restricted to
“pure Lisp” .
PARTOFSPEECH can
call to get its work done.
DRIVER that tries PARTOFSPEECH on several
different inputs.
You can cause several expressions to be evaluated by using the form
PROGN.
RANDOMREPLACE that takes the same parameters as
PARTOFSPEECH but returns sentences where each noun has been randomly
replaced by some noun, and likewise for each verb, preposition, article, and
adverb.