Answered step by step
Verified Expert Solution
Link Copied!

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

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... 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

Step: 3

blur-text-image

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

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Programming questions

Question

What are the major stressors for a student?

Answered: 1 week ago

Question

Distinguish tangible from intangible assets.

Answered: 1 week ago

Question

What is a stock option plan?

Answered: 1 week ago