Skip to content

Displays unique words in text file in alphabetical order.

Notifications You must be signed in to change notification settings

Mathurkarishma/romeo-unique-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Unique Words in Romeo & Juliet

Did Shakespeare truly have a way with words?
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. Acknowledgements

About The Project

Sometimes it is important to determine unique words in text. We might also simply be curious how truly genius Shakespeare was! Use this code to display the unique words in Romeo's famous speech confessing his love to Juliet. Finding unique words in a text file can be useful to note if a word was misspelled, that a general replace all commas and apostrophies or remove whitespaces would not do. This happens a lot due to manual entries in data, more likely in text files. An extra bonus, the words will be shown in alphabetical order. This would make it nicer for a human to read, and even for a computer to quickly search through. You're more than welcome to test your own input files to convince others that they may need to expand their vocabulary... ☺

Built With

Getting Started

To get a local copy up and running, download the alphabetical_unique_words.py file and the text input files, romeo.txt and proof.txt, into the same folder. Then run the code in an IDE software, such as IDLE, or in Command Prompt. The romeo.txt file contains Romeo's speech, while the proof.txt file was used to prove to my professor that my program works by using my own name. Easily try your own text file with this program by saving it into the same folder.

Usage

Using the romeo.txt file in IDLE:

romeo

Using the proof.txt file in IDLE:

proof

Using the romeo.txt file in Command Prompt:

>>python3 alphabetical_unique_words.py
>>Enter the file name: romeo.txt
>>['Arise', 'But', 'It', 'Juliet', 'Who', 'already', 'and', 'breaks', 'east', 'envious', 'fair', 'grief', 'is', 'kill', 'light', 'moon', 'pale', 'sick', 'soft', 'sun', 'the', 'through', 'what', 'window', 'with', 'yonder']

Contact

Karishma Mathur - karishma324@gmail.com

Project Link: https://github.com/Mathurkarishma/romeo-unique-words

Acknowledgements

Releases

No releases published

Packages

No packages published

Languages