Skip to content

UPenn-CIT599/final-project-team-42-madlibs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIT591-madlibs

Mad Libs is a collaborative project by Ross Beck-MacNeil, Brenda Moss, and Paul Lysander for their final project for MCIT 591 at UPenn.

project category: Natural Language Processing

data source (external): plain text files from Project Gutenberg (https://www.gutenberg.org/)

project software components/libraries:

  • JDK 10+*
  • Stanford CoreNLP
  • Swing (user interface)
    *Please note: attempting to load and run the program with an older JDK version may result in various error conditions.

Overview of the Game
Mad Libs is a children's game, played with pen and paper, where the player is prompted for a list of words that are substituted into a story. In this version of the game, the player selects a passage from an offering of classic literature or children’s book passages, or can provide their own passage. The passage is read in by the program and Natural Language Processing is executed on the passage to "tag" words with their part-of-speech (POS). The program randomly selects a number of words in the passage. For each selected word, the player is prompted to provide a replacement word that corresponds to the same part-of-speech (e.g. verb, proper noun, etc.) as the original word.

The player does not know the specific word they are replacing in the original text - only the part-of-speech. The program substitutes the player-provided words into the passage in place of the original words and displays the updated passage with the replacement words highlighted. Also displayed is the original literature passage for reference. Players are then given the option to play the game again.

To run program:
Clone the repository and run MadLib.java. The entire set of files including text files, index file (lists text files being used) and pom.xml file are in the GitHub repository.
https://github.com/UPenn-CIT599/final-project-team-42-madlibs/tree/master/cit591-madlibs
Maven is a build automation tool which uses a pom.xml file which provides the configuration details for the project.

To set up project and run program in Eclipse:

  1. First clone the GitHub repository to your local machine. From the terminal window, run the following command
    git remote set-url origin https://github.com/UPenn-CIT599/final-project-team-42-madlibs.git
  2. To add project to Eclipse, create a new project
    File > Open Projects from File System

3) From within Eclipse, navigate to and select the location of the project directory

4) This will import the following folders and file structure. The Mad Lib application is executed by running MadLib.java.

Playing the game
Running the game will result in the following screen being displayed as the initial screen.

The player begins the game by selecting one of he passages listed on the left-hand side of the screen, or inputting their own text by selecting "Create Your Own Literature Mad-Lib Passage" option.
The chosen or entered text will appear on the right-hand side of the window.

There are 4 subsequent screens with each screen prompting the user to enter a category of words. The word categories are:

  • singular nouns
  • plural nouns
  • adjectives
  • past tense verbs ending in 'ed'
  • present tense verbs ending in 'ing"

Words need to be entered in each screen. The player will be prompted with a pop-up if they attempt to go to the next screen without providing all the prompted words.

The final screen displays the modified text on the left-hand side of the window and orginal text in the right-hand side. Replaced words are highlighted.

The game can be played again by clicking the "PLAY AGAIN" button, or ending the game by closing the game window or choosing "Quit MadLib" from the drop-down menu.

About

final-project-team-42-madlibs created by GitHub Classroom

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages