Question: Please code in Java. The function countOccfRoots takes a text represented as a string, and a dictionary that maps words to their roots, and returns

 Please code in Java. The function countOccfRoots takes a text represented

Please code in Java.

The function countOccfRoots takes a text represented as a string, and a dictionary that maps words to their roots, and returns a map that tells the number of times each word occurs in the text, treating each word the same as its root. Words are separated by spaces, and words that do not occur in the dictionary are ignored. static Map countOccRoots (String text, Map dic); For example, if the dictionary maps verbs see, sees, seeing, saw, and seen to their root form see, then the word see occurs 8 times in the following text: The past tense of see is saw. The third-person singular simple present indicative form of see is sees. The present participle of see is seeing. The past participle of see is seen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!