GithubHelp home page GithubHelp logo

word-counter's Introduction

Comp 124: Word Counting Lab

In this lab you'll create a java object called AllWordsCounter that records counts for individual words.

You'll apply this object to identify distinctive vocabulary for Joe Biden and Sarah Palin using the 2008 VP debate transcripts.

Part 1: Preparing

  • Fork and clone this project.
  • Take a look at the SingleWordCount class, (I've completed it for you). Make sure you understand every method in the class.
  • Take a look at the AllWordsCounter class (you'll be completing this class). What's the purpose of this class?
  • Run the TestSingleWordCounter to make sure you project is setup properly.

Part 2: Complete AllWordsCounter

You need to create the array of SingleWordCounter objects, but each entry in the array will be initially set to null. As you count new words the array will slowly be filled with actual objects.

  • Properly initialize the counters variable for AllWordsClass.
  • Implement the count, getNumWords, and getCount methods. I've given you hints.
  • Make sure all the tests in AllWordsCounterTests pass except testGetAllWords()

Part 3: Complete DistinctiveWordFinder

In the last step of this project, you'll finish implementing a class (DistinctiveWordFinder) that identifies distinctive vocabulary in a particular set of document.

  • Begin by looking carefully at the interaction of countWords and countWordsInOneFile. Given the current main() method, what will primaryCounts and secondaryCounts contain at the end?
  • In findInterestingWords you'll see two TODOs, and you'll find one additional TODO in getInterestingnessScores.
  • Complete the findDistinctive method
  • Complete the getDistinctiveScore method in a way that's reasonable to you. The function will be called once for each word, with primaryCount and secondaryCount holding the counts for Biden and Palin (or reverse). For example, you might consider subtracting or dividing the counts for the two parameters. You will see the limitations of this approach, and should consider alternatives.
  • Reverse the inputs (palin.txt and biden.txt) to find distinctive phrases for Biden.
  • Tweak your scoring function.
  • If you finish, think about ways to speed up your program.

word-counter's People

Contributors

shilad avatar

Watchers

Sam Stuewe avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.