write a datastrcture code in java
Project-1: Mini-Project Parser based on List implementations 2 Project Description: - Write a simple Parser in Java, that is capable of deciding, whether a simple Arabic or English sentence is syntactic correct or not. - A possible Grammar for such sentences can be defined as follows: $ :; cobjects (for English) or :; Verb>eSubject>c (for Arabic) 1 See My tecture Notes and Pervious Students projects. Eexamples Based on the above grammar, the following sentences are correct: [The, baby, speaks, English] [The, boy, studies, English] and even [The, boy, study, English] [a, boy, studies, a, school] [speaks, English, baby, a] [study, a, English, like] are not. Hints: - A correct sentence can be regarded as a List "[ the, student, likes, English]" containing sub lists and word object at specific order. - [the, student], represents a List of a Nominal Phrase (NP) and - [likes, English] represents a List of a Verbal Phrase (VP) - Appending a List of VP to a List of NP yields a valid Sentence. - This apply also to a List of a Determiner like [the] and a list of Noun like [student] etc. A possible Solution: To create a parser for such sentences, we need at least the following lists as lexicon'? 1. Determiner: a list of determiner such [a, the, some,...] 2. Noun: a list of nouns such as [student, baby, ...] 3. Verb: a list of verbs such that [speak, speaks, study,.na] 4. However, the Lists - Nominal Phrase - Verbal Phrase - Sentence represent Lists containing sub lists; for example: - The Noun Phrase list will contain a concatenation of the Determiner and Noun tists in that order, and the Verbal Phrase list will contain a concatenation of the Verb and NP list, etc. - The final list will be called Sentence, and it will be composed of the concatenation of [ [NP], [VP]] Final Remake: in an advanued stage, you can impreve you Faner by. - Uuing more advanced Data Strecturet wch as a Dictionarles or tables instaded of litti an the word irvels. - Generative a Pane-Tress of exch correct sentence - to optimie the seanch you can alwo employ waph baned search sach as Depth Fint operating on guph GGtack boned search) or Breath finst Seach pasied on a queve)