#!/usr/bin/env python # coding: utf-8 # # Experiments in language analysis of Hegel's "Phenomenology of Spirit" # # Since long I have dreamt of visualizing complex works of literature in a style such as the [XKCD movie narrative charts](https://www.explainxkcd.com/wiki/index.php/657:_Movie_Narrative_Charts) (inspiring [scientific projects](https://link.springer.com/chapter/10.1007/978-3-319-50106-2_30)). Previously I have performed basic experiments on the [Illuminatus Trilogy](https://www.goodreads.com/book/show/57913.The_Illuminatus_Trilogy) using [NLTK](http://www.nltk.org/), and now that we have been reading the [Phenomenology of Spirit](https://www.goodreads.com/book/show/9454.Phenomenology_of_Spirit?ac=1&from_search=true) it is an excellent candidate of illumination through analysis. # # * [German text](https://www.marxists.org/deutsch/philosophie/hegel/phaenom/index.htm) # * [English text](https://www.marxists.org/reference/archive/hegel/works/ph/phconten.htm) # # ## Environment and initialization # # I intend to use Jupyter (iPython Notebook) and NLTK. Installing a functioning python environment is always messy - the recommendation is to install as little as possible as root, and place all your dependencies in a virtualenv (or docker container). # # apt-get install python3-virtualenv w3m wget # mkdir -p venv # virtualenv --python python3 venv # source venv/bin/activate # pip install -r requirements.txt # # I won't add any possibly copyrighted source material here, fetch them to the `de/` and `en/` directories: # # ./initialize.sh # In[4]: import nltk