Part 1. Fairy Tale Comparisons (15 Marks) For this assignment, we are going to do some...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
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... View the full answer
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date:
Students also viewed these programming questions
-
Assume that a firm has weighted average cost of capital of 3.6% with a corporate tax rate of 21%. The pre-tax cost of debt is 3.1%. In case the firm would have no debt, the cost of equity for the...
-
James was delivered at 39 weeks in a planned delivery. He was the largest of my babies, weighing 8 pounds, 4 ounces, and measuring 21.5 inches. He had a raspy cry, a full head of hair, and very light...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Refer to Figure 9.3. Svetlana scores 0.70 on the responsibility scale of the CPI. Dymitri scores 0.30 on the responsibility scale of the CPI. By how many T-score points do their scores differ? Figure...
-
What conditions are generally associated with the readers/writers problem?
-
Compare the throughput achieved by a RAID Level 5 organization with that achieved by a RAID Level 1 organization for the following: a. Read operations on single blocks b. Read operations on multiple...
-
True or False: The technician should never need to check exhaust piping, equipment supports with torsional pivots, and so on, because shaft alignment is all that is necessary.
-
Five Flags over New York paid $90,000 for a concession stand. Five Flags started out depreciating the building straight-line over 10 years with zero residual value. After using the concession stand...
-
Sale in kg 4 , 0 0 , 0 0 0 Selling price per kg is 3 2 rsFixed cost is 4 , 5 0 , 0 0 0 Variable cost per kg Rs . 2 4 Debt is Rs . 1 0 , 0 0 , 0 0 0 Interest rate is 1 2 % Calculate degree of...
-
18. Add the Office field to the Filters area of the Pivot Table. Filter the table so that only organizations with private offices are visible.
-
Which statement best describes the AICPA interpretation relating to form of organization? Members should practice in public accounting firms only in those states or territories in which they have...
-
How do globalized networks and digital technologies impact the manifestation and perception of deviant behavior in contemporary society ?
-
Can deviance be conceptualized as a form of resistance or rebellion against prevailing social structures, and if so, how does this influence strategies of social control ?
-
What are the different ways that the word 'zombie' is used by Phillips and The Cranberries to describe different things? Does the definition of a 'zombie' always refer to the living dead? What else...
-
David holds a US equity portfolio of 100M and wants to hedge its position using S&P500 futures. Given Futures price of S&P 500 is 1,000 Beta of portfolio is 1.3 One contract is on $250 times the...
-
Discuss and give example how deontology and consequentialism relates to consent in nursing profession.
-
Obtain a Fourier expression for f(x)=xfor-
-
Akramin just graduated with a Master of Engineering in Manufacturing Engineering and landed a new job in Melaka with a starting salary of RM 4,000 per month. There are a number of things that he...
-
What is a stock option plan?
-
Give an example of a situation for which invoking the controllability principle would have a desirable motivational effect. Also give an example of a situation for which suspending the...
-
Under what circumstances should both quantitative and qualitative performance measures be used to evaluate employee, work group, and divisional performance? Provide examples to support your answer.
-
Someone who exposes the ethical misdeeds of others in an organization is usually called a/an _________. (a) whistleblower (b) ethics advocate (c) ombudsman (d) stakeholder
-
If a manager fails to enforce a late-to-work policy for all workersthat is, by allowing some favored employees to arrive late without penaltiesthis would be considered a violation of _________. (a)...
-
According to research on ethics in the workplace, _________ is/are often a major and frequent source of pressures that create ethical dilemmas for people in their jobs. (a) declining morals in...
Study smarter with the SolutionInn App