Method that reads a text file and returns a list of tokens

Assignment Help JAVA Programming
Reference no: EM13935982

First at all, the program should be in java in JGRASP developer, the teacher requires that and while you writing the code you should pit comments for everything you do so the grader can follow the steps of the code. in the end of the work, it is necessary to write for me some information that used in the project like analysis, what kind of algorithm and data structure you used and why you use it? for efficiency and complexity! and you should test the program with different inputs or test cases !!

Text Processing Functions

INFX 141 / CS 121 • BOZHENA BIDYUK • UC IRVINE • WINTER 2016

This assignment is to be done individually; you may not use code written by your classmates. Use code found over the Internet at your own peril -- it may not do exactly what the assignment requests. If you do end up using code you find on the Internet, you must disclose the origin of the code. As stated in the collaboration guidelines, concealing the origin of a piece of code is plagiarism. Use Piazza for general questions whose answers can benefit you and everyone.

General Specifications

You may use Java, Python, or Scheme/Racket for this assignment. Java is the safest choice because the assignment is written with Java in mind and contains a variety of helpful Java resources. Using Python or Scheme will require you to translate these Java resources.

If you use Java, your solution must fill out the program skeleton provided. (i) Fill in each method according to its Javadoc specification. (ii) Feel free to create additional methods / classes where necessary.

If you don't use Java, you should produce a similar skeleton to start with and fill it out. You should also be very precise with instructions for how to run your program -- what programs are needed, what versions, and so on. If the TA can't run your program, your grade will reflect that.

You should test your code thoroughly, of course, with test data you create. You may exchange test data with anyone in the class. We will test your program with our own text files.

At points, this assignment may be underspecified (i.e., not fully describe what to do in every situation). In those cases, post your questions on Piazza or check with the TA. For minor issues, make your own assumptions and document them.

Part A: Utilities

Write a method that reads in a text file and returns a list of the tokens (preferably alphanumeric) in that file. Write a method to print out frequency results.

Package: ir.assignments.two.a
File: Utilities.java
Method: tokenizeFile(File)
Method: printFrequencies(List<Frequency>)

Part B: Word Frequencies
Count the total number of words and their frequencies in a token list.
Package: ir.assignments.two.b
File: WordFrequencyCounter.java
Method: computeWordFrequencies(ArrayList<String>)

Part C: 2-grams
A 2-gram is two words that occur consecutively in a file. For example, "two words", "words that", and "that occur" are all 2-grams from the previous sentence.

Count the total number of 2-grams and their frequencies in a token list.
Package: ir.assignments.two.c
File: .TwoGramFrequencyCounter.java
Method: computeTwoGramFrequencies(ArrayList<String>)

Part D: Palindromes
A palindrome is a words or phrase that reads. the same in both directions. For example, these are all palindromes: "kayak", "Do geese see god", "A man, a plan, a canal--Panama". Count the total number of palindromes and their frequencies in a text file.

Package: ir.assignments.two.d

File: PalindromeFrequencyCounter.java

Method: computePalindromeFrequencies(ArrayList<String>)

Once you have implemented your palindrome counting algorithm, please perform a short analysis of its runtime complexity: Does it run in linear t.ime relative to the size of the input? polynomial time? exponential time? This analysis should go in the analysis.txt file in this package.

Attachment:- Assignment.zip

Verified Expert

Reference no: EM13935982

Questions Cloud

Key leadership factors : Critically discuss and analyse, by referring to appropriate theory and by drawing on your own self-reflected learning, the key leadership factors which, in your view, make managers effective.
Discuss the unemployment rate, types, issues of australia : Discuss the unemployment rate, types, issues, and government policy of Australia and comment unemployment in various states of Australia. You need to specify in different region like NSW, WA, Tasmania, Qld or SA.
Discuss the two types of gods attributes : Discuss the communicable and incommunicable attributes of God. Knowing the differences between these attributes and then reflecting on the attributes in each classification will enhance our respect and appreciation for God and who He is and what H..
Discuss mission and vision of your agency : Assume that you are the administrator/CEO of your agency. Discuss a minimum of three ways you will continue learning about the Human Services field and expanding your education and skills. How will you achieve these goals? Keep in mind the mission..
Method that reads a text file and returns a list of tokens : Write a method that reads in a text file and returns a list of the tokens (preferably alphanumeric) in that file. Write a method to print out frequency results.
What is the sociological imagination : What is the Sociological Imagination? Why is it important to understanding what happens in the world around us? How can using a sociological imagination help solve problems facing the world today
What impact will have on effectiveness of fiscal policy : Explain with the use of a graph why the shape of the money demand curve makes a difference in terms of the effectiveness of monetary policy.
Why should we pay special attention to our cmc : How much time in a single day do you communicate with your phone, computer, or both? Why does this matter?Why should we pay special attention to our CMC
Paper - should same-sex marriage be recognized : TOPIC: Should same-sex marriage be recognized? The final paper will be graded primarily along the following criteria: Having a clear and identifiable thesis statement

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a complete java application that meets these

create a complete java application that meets these requirements1. the program has an opening comments section using

  Write a java program to read sequences of integers

Write a Java program to read sequences of integers from a text file, build a binary search tree for each sequence by inserting numbers in the sequence one after another into the search tree, and plot a picture of the finished tree.

  What are the three required expressions of a for-loop

What are the three required expressions of a for-loop. Consider the following code. This code was written to generate the output as shown in

  Provide java code to create and initialize an array

Provide Java code to create and initialize an array of integers (Java primitive int), floats or any other Java primitive type of your choice. You pick the array name and length.

  Write an application bmicalc

Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.

  Design a class that can be used to hold information

Implement and design a class that can be used to hold information about a musical note - Prepare a complete java program the default constructor should set a note to a middle C quarter note.

  Features of any programming language is recursion

One of the most useful features of any programming language is recursion and control structures, decisions and loops. Recursion and loop structures allow programs to repeat actions without duplicating code.

  Design a class that keeps track of a students food purchases

Design a class that keeps track of a student's food purchases at the campus cafeteria. A meal card is assigned to an individual student. When a meal card is first issued

  Java gui program to calculate monthly payment

Java GUI program to calculate monthly payment. The GUI has JTextFields and JButton

  The user enters an invalid value for hours

Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must contain three exception classes: InvalidHrExcep, InvalidMinExcep, and InvalidSecExcep. If the user enter..

  Write a complete java program called parser

Write a complete Java program called Parser that gets a comma-delimited String of integers  (eg "4,8,16,32,...") from the user at the command line and then converts the String to an ArrayList of Integersusing

  Create exception classes

First, create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException. Both NumberHighException and NumberLowException should be directly subclassed from the Exception class, but NumberNegativeException s..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd