Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program for this assignment must be created in Java coding format. Please provide comments for each line of code if possible for a better

The program for this assignment must be created in Java coding format. Please provide comments for each line of code if possible for a better understanding of the process.

Natural language processing (NLP) is an area of computer science that focuses on how computers can make sense of human languages like English. Before text data can be used in NLP, it must often be cleaned. Suppose you want to clean a string by removing the punctuation and common words listed below.

Punctuation marks to be removed: . , ; : ! ? ( )

Words to be removed: a an the is am are and or

Within a source file named SentenceCleanup.java, write the static method String cleanText(String s) This method returns a cleaned version of the string s, as described above. Assume the words in s are separated by single spaces, s does not begin or end with a space, and s does not contain any non-letter characters besides spaces and the punctuation above. The method should return a lower-case, space-delimited version of s, with the punctuation and common words removed.

Here is an example argument and return value:

Argument: "Omg, so like, the fox, like, TOTALLY jumped over the lAzY dog!"

Return value: "omg so like fox like totally jumped over lazy dog"

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

Why are asset purchases not recorded in a purchases journal?

Answered: 1 week ago

Question

What is a job analysis?

Answered: 1 week ago