Question: For problems 3-5, your solutions must use only the following methods from Java's String class. Do not use regular expressions if you happen to be


For problems 3-5, your solutions must use only the following methods from Java's String class. Do not use regular expressions if you happen to be familiar with those that would cheapen the experience :) charAt(int i) indexOf(int targetChar) 1 OMP 2150 - Spring 2021 Homework 0 Due Fri., Feb. 5, by 2359 CST indexOf(String targetString) length() split(String pattern) substring(int i) substring(int i, int j) toLowerCase(). toUpperCase() 4. (15 points) 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
Get step-by-step solutions from verified subject matter experts
