Skip to content

About

Analyze a text file to detect rhymes between line-ending words, build a network from those relationships and visualize the resulting structure with D3.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

35 Commits

Folders and files

Repository files navigation

Networks Of Rhyming Words Visualized

A screenshot featuring a network graph visualizing rhyming words from all of Edgar Allan Poe's poems.

Analyze a text file to detect rhymes between line-ending words, build a network from those relationships and visualize the resulting structure with D3.

Application Overview

This application analyzes a plain text document to identify rhyme relationships between the final words of each line. It uses the CMU Pronouncing Dictionary to compare phonetic rhyme endings, while also accounting for stress patterns, word frequency, repeated positions and fallback spelling-based similarity when pronunciation data is unavailable.

The resulting words are represented as nodes in a rhyme network, with connections weighted by rhyme strength. The application exports this structure as JSON, with optional GraphML and GEXF support, as well as visualizes it through an interactive D3 graph where users can explore rhyme families, clusters, repetitions and relationships across the source text.

Basic Setup Instructions

Below are the required software programs and instructions for installing and using this application on a Linux machine.

Programs Needed

Steps

  1. Install the above programs

  2. Open a terminal

  3. Clone this repository: git clone git@github.com:devbret/networked-rhyming-words.git

  4. Navigate to the repo's directory: cd networked-rhyming-words

  5. Create a virtual environment: python3 -m venv venv

  6. Activate your virtual environment: source venv/bin/activate

  7. Install the required Python packages: pip install -r requirements.txt

  8. Place your .txt file at the root of this repo

  9. Process the raw data: python3 app.py -i my_file_name.txt

  10. Start an HTTP server: python3 -m http.server

  11. Access the visualization in a browser: http://localhost:8000

  12. When finished, close the HTTP server: CTRL + c

  13. Exit the virtual environment: deactivate

Other Considerations

Below you will find information not covered in the installation and use sections above. Including the abilities this repo is intended to demonstrate. As well as an overview of the license this code is made available with. And a way to contact the maintainer with questions, suggestions and collaboration opportunities.

Abilities Demonstrated

This project repo is intended to demonstrate an ability to do the following:

  • Analyze song lyrics to identify rhyming words and convert them into an interactive network graph

  • Detect rhyme relationships between line-ending words using pronunciation data and stress patterns

  • Export rhyme data as JSON, with optional GraphML and GEXF formats

  • Visualize rhyme families with D3.js, allowing users to explore connected rhyme clusters

License Information

This repository is distributed under the MIT License. You are free to use, copy, modify, merge, publish, distribute, sublicense and sell copies of this software, including as part of proprietary or commercial work. The single condition is the copyright and permission notices contained in the LICENSE file must be included with any copy or substantial portion of the software that you redistribute. The software is provided "as is", without warranty of any kind, and the copyright holder is not liable for any claim or damages arising from its use.

If you have any questions or would like to collaborate, please reach out either on GitHub or via my website.

About

Analyze a text file to detect rhymes between line-ending words, build a network from those relationships and visualize the resulting structure with D3.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages