Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

write a datastrcture code in java image text in transcribed
image text in transcribed
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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago