Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1. Fairy Tale Comparisons (15 Marks) For this assignment, we are going to do some basic processing on a few texts. Download the
Part 1. Fairy Tale Comparisons (15 Marks) For this assignment, we are going to do some basic processing on a few texts. Download the .zip file provided. It contains a java file called Ass01.java, as well as 4 text files. Each text file contains the story of Little Red Cap in a different language. For this assignment we are going to compare a few stats about the words and sentences in each language. a. (8 Marks) Read in each of the stories provided using the method provided. We are going store them in a single 3D array. In this 3D array, the first dimension represents the stories, the second represents the sentences, and the third dimension represents individual words. Use the .split() method of the String class to break up your texts. a. A sentence is defined as a group of characters delimited by one or more periods, question marks, or exclamation points, which are then followed by a space. Remember: Periods are special characters in Regex! b. A word is defined as a group of characters delimited by one or more spaces, newlines, or dashes. b. (3 Marks) For each story display a. The file name b. How long the story is (measured in total characters). c. How many words the story contains. d. How many sentences the story contains. c. (2 Marks) Display which language has the longest average sentence length. The length of a sentence is measured by how many words that sentence contains. d. (2 Marks) Display which language has the longest average word length. The length of a word is measured by how many characters that word contains.
Step by Step Solution
★★★★★
3.41 Rating (145 Votes )
There are 3 Steps involved in it
Step: 1
Heres the logic and steps to complete the assignment 1 Unzip the provided zip file to extract the Ass01java file and the four text files 2 Open the As...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started