Question: n Dont worry about the extra credit but please complete all of the problem thank you. In this assignment, you will use LISP to understand
n




Dont worry about the extra credit but please complete all of the problem thank you.
In this assignment, you will use LISP to understand natural language requests which represent database queries. Your code will parse the request into the parts of speech. For extra credit, you will generate a SQL statement for the parsed request Sample Requests: Count the number of rentals Show ID for movies Show title of movies with rating equal to PG13 Count the number of rentals with date after 2018-10-01 Show title for the movie with ID equal to HP001 Show title for movies with rating not equal to G Show title for movies with genre equal to romance Show title for movies in the horror genre (extra credit) Count the number of movies with a PG13 rating (extra credit) * . Simple request grammar: Request: Verb DirectObj Prep IndirectObj [Prep QualifyingPhrase] QualifyingPhrase: QuallndirectObj ['not'] Comparator [ Prep] QualValue DirectObj:NounPhrase IndirectObi: WounPhrase QuallndirectObj:- NounPhrase NounPhrase [Article] Noun Notes Brackets indicate something that is optional. For example, an Article is optional in a NounPhrase The italicized words in black are nonterminal symbols, meaning that they are replaceable with something else A symbol in black surrounded by quotes is an actual word (e.g., 'not') * The symbols in blue within the grammar refer to words. Most of these are defined using the set_isa macro which you must code. (See the set_isa documentation below.) Additionally, you can determine the part of speech for a word by using the isa function (which you must code) Verb values include at least count, select, show, and print. Prep values include at least of, with, to, in, and for. Comparator values include equal, after, and before Noun values include at least movies, movie, rentals, rental, customer, and customers It will also include attribute names in the database tables QualValue includes too many values to list since it will reference database values. You will not validate these This program uses three hash tables: parse-obj- contains the original request, a cursor position, and a value for each part of speech In this assignment, you will use LISP to understand natural language requests which represent database queries. Your code will parse the request into the parts of speech. For extra credit, you will generate a SQL statement for the parsed request Sample Requests: Count the number of rentals Show ID for movies Show title of movies with rating equal to PG13 Count the number of rentals with date after 2018-10-01 Show title for the movie with ID equal to HP001 Show title for movies with rating not equal to G Show title for movies with genre equal to romance Show title for movies in the horror genre (extra credit) Count the number of movies with a PG13 rating (extra credit) * . Simple request grammar: Request: Verb DirectObj Prep IndirectObj [Prep QualifyingPhrase] QualifyingPhrase: QuallndirectObj ['not'] Comparator [ Prep] QualValue DirectObj:NounPhrase IndirectObi: WounPhrase QuallndirectObj:- NounPhrase NounPhrase [Article] Noun Notes Brackets indicate something that is optional. For example, an Article is optional in a NounPhrase The italicized words in black are nonterminal symbols, meaning that they are replaceable with something else A symbol in black surrounded by quotes is an actual word (e.g., 'not') * The symbols in blue within the grammar refer to words. Most of these are defined using the set_isa macro which you must code. (See the set_isa documentation below.) Additionally, you can determine the part of speech for a word by using the isa function (which you must code) Verb values include at least count, select, show, and print. Prep values include at least of, with, to, in, and for. Comparator values include equal, after, and before Noun values include at least movies, movie, rentals, rental, customer, and customers It will also include attribute names in the database tables QualValue includes too many values to list since it will reference database values. You will not validate these This program uses three hash tables: parse-obj- contains the original request, a cursor position, and a value for each part of speech
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
