#The Once and Future Visualization
Project by Dylan Nugent <dylnuge@gmail.com>
University of Illinois at Urbana-Champaign
Two visualizations of chapters from "The Once and Future King," by T. H. White. This repository contains both the code for generating the visualization input given the text files for the document and the code for the visualization itself. For copyright reasons, the input text is not included here.
The first visualization, in the wordle
folder, is a chapter-by-chapter
breakdown of unique words used within The Once and Future King.
The second visualization, in the hierarchy
folder, is a drill down view of the
four major categories of open words (nouns, verbs, adjectives, and adverbs) used
within The Once and Future King by their synonym categories.
The parser is a Python 2.x program using the NLTK library for text processing.
To set up an environment for it and run it on input files (assuming you are
starting in the parser
directory):
- Run
virtualenv env
to create a new virtual environment. If you have Python 3 as your default virtualenv target, modify this command to make a python2 virtual environment. - Run
source env\bin\activate
to activate the environment. - Run
pip install -r requirements.txt
to install NLTK. - Run
python parser.py
with the list of chapters as your arguments, seperated by spaces. For instance, to run on four chapters of The Once and Future King namedofk1.txt
throughofk4.txt
runpython parser.py ofk{1,2,3,4}.txt
.
The visualizer is entirely static HTML and JavaScript code that expects a file
called "vis_in.json" to be present in the data directory. To run it, simply
open index.html
in a browser that supports D3 (should be pretty much all of
them).
Created by Dylan Nugent at the University of Illinois at Urbana-Champaign for CS 398VL (Visualizing Literature) in the Spring 2014 semester.
Copyright 2014 Dylan Nugent. All Rights Reserved.
I intend in the future to release this under an open source license.