Question: This assignment must be created in Java. Add comments for the explanations of the code. Natural language processing (NLP) is an area of computer science
This assignment must be created in Java. Add comments for the explanations of the code.
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
In a class named SentenceCleanup, 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
Get step-by-step solutions from verified subject matter experts
