This project uses XML to create a website capable of detecting and analyzing metaphors and similes in The Picture of Dorian Gray by Oscar Wilde.
The goal is to mark and connect figurative language associated with identity shifts and creation (metaphor, simile, and aphorism) — identifying co-occurent words between these language systems to better visualize and navigate their evolution throughout the text, in hopes of revealing how The Picture of Dorian Gray uses figurative language to create social critiques by converting people and identities into walking, talking, abstract social archetypes, whose actions become reflections of a social reality.
1. Limiting markup to similes metaphors and aphorisms didn't take into account that Wilde often uses imagery to convey changes in identity.
a. Tried to solve this with a full text query in the metaphor panel, but not having it in the data for finding co-occurent words makes the tool less useful.
2. Filtering out filler words from the Analysis Panel.
b. In progress
3. The Gutenburg Text we got The Picture of Dorian Gray from had some formatting issues that have persisted. Leading to the reading view being less readable.
c. Considered indexing paragraph nodes to group them together in 5s, but this is only aesthetically better and similarly alters the reading experience from Wildes vision.
Certain words like beauty, life, painter, soul, influence, and canvas have rich co-occurences and can be found through many pathways, with a clear progression from aphorism to metaphor and metaphor to plain text.
The process began with a close reading of The Picture of Dorian Gray, marking metaphors, similes, and aphorisms as I read. These sorts of figurative language where chosen because of their relationship with identity formation (aphorism) and identity transformation (metaphor, simile). After this was done XSLT was used to transform the XML into a structured HTML webpage that the browser can display and JavaScript can interact with. It converts each paragraph into a numbered p element with a unique ID, and converts metaphor, simile, and aphorism nodes into HTML elements that preserve their tag names while adding data-type and data-sentence attributes so they can be styled with CSS and located by JavaScript. It also creates the overall page layout (reading, analysis, and metaphor views) so the JS can later switch between panels and build interactive features on top of the static document.
The JavaScript runs off of the HTML and builds two internal data structures: one that indexes all figurative language nodes (metaphor, simile, aphorism) and another that indexes all paragraphs as “sentences” with tokenized word lists. This was done so the user can find co-occurences of words in their transformation phase as well as when they show up as re-iffied plain text. When the user clicks on one of the highlighted bits of figurartive language, they are taken into an analysis view, there the sentence is rendered as a series of individual clickable words. When a word is clicked a co-occurrence graph is generated from the cached figurated nodes, with the 10 most co-occuring words having a bar the user can click on. From there, clicking a graph bar takes the user to a filtered view of the text that shows all sentences where two selected words co-occur, using the cached sentence data to render results. Metaphor, Simile, and Aphorism are highlighted and sentences are displayed in the order they appear, so users can see how a concept transforms over the text. Each sentence is clickable and will take the user back to the reading view at the point in the text where the sentence they clicked on appears, allowing them too search for relevant language that appears closely to the transformed concept, and is likely related.
Project Gutenberg Edition:
https://www.gutenberg.org/files/174/174-h/174-h.htm