{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Punctuation in novels\n", "Inspired by [Punctuation in novels](https://medium.com/@neuroecology/punctuation-in-novels-8f316d542ec4#.qwj8e1n8m).\n", "\n", "Texts used here are [The complete works of Sherlock Holmes](sherlock.txt), [War and Peace](war-and-peace.txt), [The complete works of Shakespeare](shakespeare.txt), [Ulysses](ulysses.txt), and [Pride and Prejudice](pride-and-prejudice.txt)." ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import string\n", "import collections\n", "from PIL import Image, ImageDraw\n", "from math import ceil\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `string` module has some nice subsets of characters. Does it know about punctuation?" ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~'" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "string.punctuation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting the punctuation\n", "First, let's just open a text file and read the punctuation. We can also count the number of different punctuation characters in it." ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "collapsed": true }, "outputs": [], "source": [ "sherlock = open('sherlock-holmes.txt').read()" ] }, { "cell_type": "code", "execution_count": 70, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "..-.......'.........,,,.,,,.,.-'..,-,.,,...,-,,,,,,,,.,,,,.:,,.,,,.-,-(,.-,,,,.,,,,.,,.,,..-...;,,.,,,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\",.,\"\"\",\".,.,'.,,,,,\",.\"\";\",,..,,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\"\"\"\",\"\"\"\"?'\"\"!...,,.--,,,\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,..\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".'''''''''''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',..\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.-,-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\"\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\".\"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,!-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\",!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\"\"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\"\",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\".',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\"\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\".\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,.,,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,,.'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''.',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\"\"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\"...,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\",,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\",,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\"\"\"\"\"\"\"...\"-..,,,.,,,-,.,,,,.;,.,-,,.,,;,.\"\".\"\".\",,'\".\"'\"\"'\".\"''.,,.,'\"\"'.,\"\".-..,\",.,,.,,..,-.,,..,..\"\",-,,--\"\".,.,',..\",\".\".\"\"\"\"\"\"\"\",\"\"\"\"\",.\".,,.\"\"\"\",,.,,,.\"\"\"\"..?-,.,.,,,\"\"\"\"-.,.,.,.;-.-.....-.,-.,,,,.,,,.;,.-\"\"\".\".-,,.-,.\"\"\"\".,.,,.\".:\"-,\",.\"'\",.\",\".,.\"\",.\"\"\"\"\"\"\",.\"\"\"\",\"\"\".\"\".\"!\"\"\"\"\"\"\"\"\"\"\"\"\"\".,.,'\"\".-!!\",.,..\".,\".\".\",.\"!.:\"\"\",.\"\"\"\"\"\".\"\"\"\"-,.,,.-,,,,.,\",.\".:\".--..,.,,....,,.,,.,,...,,,,-,,.\",,..,,-,.\",;-.,...,.;,.,\",\",\"\"-,\",.\"??\"\"\".\"'\"\",\";\"..\"\"\"\"..-\".\"\".\"\"\"\".\"'\".\",\"\"..-\",,,.,.'.,.,,..-,.,,-,.,.\",\".\"\"\".\"\"\"\".,.,,\",-.\"\",,.\",,.,,,\"\"\".\",,,\"\"\"\",,,.,.,.,,,.,.,.,...,,.,,\".,,,,.,,.,,,.',--,,,.-.,,,.',.\",,,,,\".,,.\",-,,.\".\",,.','\"\",..,\"\",,,\"\"',,,--\"\",,.\"\",\"\",\"\"..'.,,-,\"..\",\".\",,\"\",\",\".'',,,.,.\"\",\".\"..,\":\"-:,,,..,.--,.,',,,',\"\"\".,.\",'\".\",.,,,.,,\"\",.\"\".,.\"\",,.\",;\"',.',.,;\"\"\".\",',.'.,.;.,,,\"\",?..'\"\",,\"..\".,.,'.'\"\",\"\",.,-',.,,;,.\".,,,:',.,-'''.'',''-.',,'.,''',,'.,.,--,,-.',.'-'.''',,'''.',,,''\",,-,.''.'',,',.,,,.-,-;,.''','-'''.',.,.,,,,,,.,,.,;'\",,,,,.,.,.\",..,,,.-,''..-,,,,-,,;,,-.,;.,,.,,;\"\"\".\"\"\",.,.,.,,,.'.',''''.'.',,.,,.''.',,,',.''.'.,.''.,-.'','.,.,.?'\".\".'','!.,,-.'\",.,;.'',',.'',,'.',,.'.''''.''\"',.,,-;.,,.''.''''''''''',,,.,..'''','.''.;'.,''''\"\".,,-,.-'''.',-,.,',,.\",,;,.,'',.,,,-,,'.\",,.,..,;.'-,,.\",.,'.,.,..,,,.,,,,,,.\",,'.,.\"\"\"\",..',,.,\"-.:-.,.,.\"\",.\",\"\",\",.\"'..,,.\"\",..,.,,-,-.....'','.'',-''''','..'''',..,,.''\",.,-,..\"\"\".\"-,...,..,,,\"\"\".\",.\"\"\"..\",\"\"\",\".,,,,.\"\",.,,--.,\"\".,,,..-\"\"\"\"\"\"\"\"\"\",\"\"\"\"\"\"-,\"\"\"\",\"\",-,,,'.\".\"\".\"\"\",.\"\"\",.\"\"\",,;\"\"\"\",.'\"\",...-,\"\",\",\"\"\"\".\"\"\"\",\".,,.\"\",\".\"\".\",'\",-,.,,.\".'\".\",?\"\"-.\"\".,.,.,.\";-,.,,-,--,--.\"\",,-.,.,,.',,,.-,-,.\"\",\"\"\",\",.\",\".\",,,.\"\"\",\".'-.\"\"\"\"\"\"\"\"\"\"\"\"\"\",,.'.-.\"-..,..\"\",,\"..',,,,,'-..,,','.,-,,-\",.,,,,-,,-,-,.,,,.;,,,,-.,,..'.\",,\".\",\"\".\"\"\"\"..-.-\"\"\"\"\"\"\"\".,,,,\",,.,.,,,.,-\"\"-,.,?,?-'-.,.-,.,.,,,,,-,-.\"!\",-.\",.,?.,-'\"\"',,\".\".\"\"\"..\".,\".\",,',,.,,\"\",,.,\".\",.--\"\"\",\"-,.,.,,;,,\"\",,,,.',.,,.',.,.,,.',.'\"\"-.'.,.,,.,\".-.\"\".\",..,...,\".,,.,,.,.,,..,,-,,,,.\"\".\"\".,.\",,\",.\"\".\".,\".,,,,.,.\"\",\".,.,--..,\"\"\".\"\"\"\"\".,.,.,.,\"\"\".\"...,\"\"\"\".,,,.'.,,.,,.,.,,.,,\",,.-.,'.,,,.\"\".\"-.,\"\"\"\".\"!,.,;,,,-,....,,,,,,.,,.,.,,.,,,,,.-,,,,,--,.,,.\"'\".\"?!,,,'\".,.,'',.\"',\".\"\"\"\".\",-\"\"\".\",!.\"\"\".\"-\"\"'\".\"'.\"\"\".\".,,''''\"\"\".\",,,,-\"\"\"..\",.\".,\".\"\".\".\",,,-\"\",\",\",''-.,,,.''.,,?,,,.,\"\"\"\",.,,.',,.,,.?',.!..-.,?.\"....,,,.,...,,...,',.,\"\"-\".\",.'-,.,,.,.-\"\"\".\",\"\"\",.\"!..\"\"\"..\",,,\".\"'''-'''\".\"\",\"..,,,,,,-,,,,\"\"\".\",,,.,,,\"\"\".\",,,,.,\".\"\".\",,,.---\"..''',.,,,,,,,.\"\",\",.\",,,.,,,,,-.,,\",..\"\",\".\"\"\",.\",,\"\"\".\",.,,.,,.,,,.,,.,,,,\"-.,,-.,,,.,,,,.\"\",.\".,..,.,,.\",,--.,,,.\"\",\"\"\"\",\"\",,,,-.\"',.\",\"\"\"\",;\"..,\"\",,.,.,.,.',,,.\"\"\",-..\",\",\".-,-.,,,,,\"\"\",\",,\"\",.,,,\"\"\"\",,.',.,',.,,.,;.,,.,'\",,,.\"\",\"\"\",,..,/.,\"\"\".\",,.\"\",.,',.,..,.,\"\"\".\",.,..\"',.\"'\".\",,....-.,;?,'.,.,,,,,.,,.\"\"\",\".\"\",,.,,,,\"\".',,.\"\",.,,-,.,,,.\"\"\"\",'.',.,,,\"\".?\"\",,.,.,\"\"\"\",,...-.---\"\"\"\"',.,'\"\",\"\"\"\"'\"\"-\"\",\"\",.,,,',,.,.,\"\"\".\"..\"\",..,...',,,,.,,,,\"\",.,,\"\"..,,.,..,,;,,.',..,;',,,\"\",\"\",;\"\"!.,,.\"\",,..',',..,-,.,-,,!,.,.,\"\"\".\",,!.,,,;,,.-,\"\".,,\"\",.,.\"\"\"\"\"\".\"\",\"\"?\"\";,,,.,,?,,,,.,??,-,'\".\"\",,\".,.,.,\"\"''\"\"\"\"\"\".\"\"'\".\"\"\".\"\".,\"\".',.'\"\"&,\"\"..,.,\"\",.,..\",.,.,,.,,,,,-,.\",\".\",,,.,,',.,,.\"\"\".\",.,.,-,-.,'?\"\",-,-,.,,.,,..'.,,--,,-\".',,..,,.,,.'..,,.,,.-,,,,,,.,,-,,\"\"\"\",,.,,;-,.,,,.,,,,-,\"\"\",,,'.\",,.,..,.,,,..\".\"\",\",...;,,,,,-;,.,,-,,,,-..-\"\"\".\"\",,\"..,.,,\"\"\".\",.''.,,,.-,\"\"\"\",\"\"\"\",.,,.,',.,'..,,,\"'.,;,,.,,.,.',.,,,,.-,,.\",\".\".\"\",,\".\",!.,,,.,,\"\",,\",,.\"',.\".\".\",-,,-,-,,,.,-,.\"-,.\".\",'\"\",.,,.,.,,,,.,,,.,,\"\"\";\".\"..\"\".\"\",\"'.,.,.,,.,'''',\"\",\",.\",.\".\"....,'''''',,,\"..\",.\".\",,\"\"\",.\",,\"\"!\".,.\",'-'\".\",..,.'!\",.\"-'\".\".,,.,,\",,.,,,,,.\"\",\".,,..,,-,,,.,,,?..,,.?.,,,,',.,\"\"\".\"\"\".,,,,.',..,.,,'...'.,.,,,,.,,,-.,.\",.\",,.\",\",.,\"\",,\",,\".,.\",',\",',-\",,,..\"'-\",,.\",.,,\"\"\".\",.,,,.,,.,,.,,,.,,\"\"\"\",...-,,,,.,.,.&,,,.\"\"\"\".,',',\".,,.:\"?...:\"\",\",.\"\"\"'.\"\",..,.'\"\",\".\",,\".,,.,,--.\",\".\",..\".,-,..\"\".\".\"\"..,,\"\"\"\"..,.,,\"\",\"\",..,,.\",..,.,,.,-.,.,,,,.,,,.,-.-.,-...\",,,,.-,,..\"-,.,,,-....-.,.,.,,..\",-,.,.,,-,.,,.,..,.,..,-.,,...-',.,'',,.-\"\"\".\"\"\"\".\",,.,,,.,,,,,,,.,,,-\"\"\",\"\"\"\",.\",..,.,-,.-\"\"-\"\",..,;,,...,.,\"\"\"\",.,,.'\"\"\".\",\"\",\"\"\",\".,.,,,,.,-.,,,,,.-\".\"\".\".\"\"'\"\",,,.,\",..:\".,,:',,.,,.,,,,.,.,-,;..\"\".,..,.,.,,,.,.,.,.'-,,.,.,,,,.'\":?\":,.\":?\":..\":?\":.\":.\":..\":..\":.\":''?\":.\":,,,?\"(:.\":?\":.\":?\":,..,,.,.''','''','''''''''''','\"\"\"\",\".,,,,'.,,\".\"\",\"'.'?,;,,.,,,.,.,\"',,,-.,-,-,.-,,..\"\".\",\"\"\".\"\".\"\".\"?-,.,.,.-\".\",,\".\",.,,',,.,,.,!\".,,,.\",.\",,,',,\"..'.,,..,;-.\"\",\".\"\"\".?,?\"\"\"\",\",.\"!\".\"\".\".!..,\"\"\".\"....;,--,.,,,\"\"\".\"\"\",..\",.\"\".\"-\"\"'\"\"\"\",?,.,...\"\"!!\"\",\"\";-,,,.\"\",\"\",.\"\"-..,,.,\"\",\"\",,.-,\",.\",\"'.\"?-,\"\"\".\"\"\",\"\".-\"\"\"\".,,\",,,-.,,,,.',,,,,?.??,.'...,.,,.,'..?..,.?..,,,.!',''..,.\"\".\".,,.\"\"\"\"\"\"\"\".,.-,,,\"\"\",\"\"\",.,,,,,,-,?,,.,,.,,,,.,...,,,,,.\"\",\"\"!?.,,,.''..,,-\",,.',.\"\".\".,,\"\",\".\";,..',,,,\"\"!\".\",!.\"\"!,,,',,,,,?,..\"\"\",.\",,\"\"\";\"\"\",\".\"-\"\"\"\",\",.\"\"\",\",-,-,-,.,,,.,,',,',.,-,....,.,,,,.,,,,,.,.,,,,.,,.,,.,-,..,'.,.,,,,.,,.,,.\"\".\"..-\"\",,!!.,.,.-,.\",.\"'.,,...'.,?-.?,!?!!,,!,,-.\",,,..,,.,.,.\"\",.\".,.,.,\",.\",\",.\"\"\"\"\"\"\",\"\"....\"\"\"\",-,,--,,-,-.,\".\"\".\",-\"\"\".\",.,\"\"\"\",\"\"\"\"\"\",\"\"\"\"\"\".\".\"\",\"-.-\"\"\".\"..-.\",,.,.\",\"\".',.\"\"\"\",,',.,,''..,,'.,\"\"''\"\",.,,..''.'',.\"\",\".\"\".\"\".\"\"\"\".\"\".\"\"\".,..,\"\"\".\".,,.,',.\"\"\"\",,\"\"\"\"-.,\"\"\"\".\"\".,,\"\",\"\"\"\"..?-\"\"-\"\".,.,-?..,.,,,,,.,.,\"\"-\"\"..,,,-\"\"\",\",..-\"\".\",-,..,,,-,,.,,,,,..\"\".\"\"\",-.\"\"\"\"\",.\"\",.\".\".\"\".\".\"\"\".\".-\"\"\".\"\"\".,.,\"\"\".\"..\".\"\".\".,..\"\"'\";\"',,.;,.\"',....,.'.\"''.,-,;,,,,.,,,,.,.\",.,,.,,.-,.,,,.,,..,,,.,,..,..\",.',',;''.',,.'-',-,''\",,,.,,;,,.,.,,,,,..\",,,,,..;,,.....\",....?.,.!.,...,...;,.,,\"\",\".\"\"\",.\"\",..,.,;,,\"\",\".\",,\",.\"\".\",?',,',,'\".,;..'',.,,,,.,,,,,,,.,,,,.',.,,,\",,.,,,',,-.,.,.,,-,.,,.-,'-,.',.\"\",,\".-?,\"\"\".\"\"\",\"\",..'\",,..\"\".,--,-,.,.,,.\"\",-.\".\"\"\".\".-,\"\",\"\"\"\"\"\"\"\"\"\"\"\",..\"\",.\"\"\"\"\"\"\"\"-,\"\"\"\"\"\"\"\"\"\"\"\".\"\",,,,\"\"\".\",\".\"\",\",,,.;,.\"-.,.,.\",.',,.,.,.,,.,-,-,.,.,,.,,.\"';,,.,..,,.,.,,,-,,.',.\"-,-'.,,.'','!',,.,.,,,,'..!',,',,'','.'',,.,,..?-,,,,,,.',''.'-,,'\",.,,,,.,,.',','.,,,,,,.,!,,,.-,'..'\",.,,,.,.,.,.,,,,,,.,,,.,,,.\",,.,,.,,-,.,,,,'',,.,,,,,\"\"\",\",,.,\"\",.,\"\".\"\",,,,.,.,...,',,,'.,,.,-'..,,-.\",','.-.,.--,.',,'.\".'..,'.\".''.'.''',.'?'.'.';'''',.','.''',.''.'?'''.'.'''',.''\",.,,.\",,.,.,,.,.-,,.,.,,,,-,'',.,,,.,-.\".?,',.\",',,.,,.,;\",.\"\".\"-.':'..';''\"\"\".\"\"\"\"\"--,-\"..,,\"\"!\".\",,..\"\"\"\"\"\".,,,\".\"\".\",,,\"\"-\"\".\".\"\",\",,\"\".-\"\"..,,-\"\"\".,,,-,.\"\",\",.,,,,.,..'\",,.,\",\":\"...\".,,,..\"..\"..\"..\"\"\",.\"..\"\"\"\"...,..,,.\"\"\"\",,.;,..\"\"\",.\".\"\".,,,.\"\"\"\".,.\"\"\"\".-\"\",\"\",.\"\",,.\"..,---.,.,-.\",\",\"\"\",,\"\",.,,.\"\"\",\"\"\"\".\"?..,\",-.\"\",\",,.,,...,,,;,,,,,.,,,.,,,\"\"\",.\".,,,.,-,,,,-,,,,-.,,\".\"\",\",,-,-,.,-,.''...,..,.,.\"\",,\"\".\"\".\"\"..--..,,.\"\"\"\"\"\"\"\"-....,,.-\"\"\"\"..,..,\"\"\".\",\"\"-..'.,.,....\"\"\"\"-\",-\"\"\"\".\"\":'..-,,,,,,.,.--,.,.,,.,,,..,,,'\"\",,\"...,\"\"-\"\".,,',,--,'.,,,,,.,,,,.-,-\",..\"\";\",,'\"\"\".\".,\"\"\"\",.\",..\"\",\"\"\"\",,\".\",.\",'':\"-,,,.,,,,-,.,,,,-,.,,,.,-.,,-\",.\",\".\",,.,,,.,-\",.\"\".\"?.,,,,.,,.\"\"\"\";.,\",..',.,,.\"\".\"..\"\"\"\".\"\"\"\"\"\"\"\"..,,-.\"\"\",..\"...\"\",'',\"\"\",.\".\"\"\"\".,\"\",\",.\"\",\"','.-.,,'',,,\"\",\"\";\"\"\"\",'',',.\"\"\"\"''.,.,\"\",\"\",.,,-..,,..--,\",,,,,..\"\",.-,\".\",\"\".,,.,.',.,,;',.,,,,.,,,,-,,.-,'-,.,-.\"\".\"'\",.,,.,,-,,.\"\",,-,,',.\",'\";\"\"\"\",,\".,!\"\"',\".-.\".,,.\"\",,!',.'..\"',,..??.,,.,,,.--,,,.,,,.?,,?,.?,,?',...-,,,...--,,.,,;-,,,,.,,,,,,-.,,,.,,,,,,,.,-,,,,.,,.\".\".\",.,\",,,,,,.\"!'\".,.\",,'\"\"\"\"\"\",\"\"!..'\".\",..\"\".',,,,-.'.'-.!\"\",\"\"..,..\",,,.,,\",\"..,,,,,,..-..,,,,,.,,,,-.\"\",\"\"\"\";\".\"\"\"\".,..,\"',,.,,;,.,',,.,..,,.\",\",\"-,\"\"\"\"\"\"\"\"\"\"\"\";,,,.,,,,.';,.-,',\"\"!\"\",,..-,..\"-,'.\",\",-,.\"','\"\"\"\",;.-\"\"\"\";..'.\"\",\"\",.-\"\"\"\".'..,;.'.-,..,\",,,,.,,,.,.,,,,,.,,,,.\",\".\".',,-.-\"\"\"\".,,.',,'.,',,\"\",\"\"-,,-,.,.,,.,,.,,:...-,,,,.,,,.,,.\"..,,.,,,,.,,,,-...,,,',,:.\"\"\"\",,..,,.,,,,-.,,.,.,,.\",---.,,,,,,.,,-,,.,,....,,,,..,..,,.'..\",,.,.-,.,..,...,.,,,-.,...,,.\".,,..',',.,,,'.\".,..,.,.,-,,,.,-,.,.,,.,,,,,,,,,,,-.,\"\"\".\"-\"\";-.,,\"\"\"\"..,,.,,,.,,,,.,,--,-,,,,......',.,,-,.\",-..',.,.\"\"\"\",'.---....\"\".\"\",,..,.?-.,,,.,,..,,'.,,\"\"\"\",.,,,.,.,-.,,,-.\",,.,,,.\"\".\",,,.?,,,'\"\"\".\"...,.,,..,,\".-',,,-.,,,,.,,-,,,,.\"\",\"\",,.\"\"\"\"\"\"\"\"\"..,\"\",..,\"\"\",.\",,,\"\"\",\",.,,\"\",.\"--,,\",\"\",\"\".,.,\"\"\"\",\".\",\",-.\",,,\"\"\"\"\"\"\"\"'.\"\"\"\"\"\",.,-\".\"\".\",-\",.\"\"\"\",..,,.\"\".\"',\"\",\"\"\"\"\"\",,,.,-.,,.,,.,,,..!\"\",.-\"\"'\"\"\"\"\"\".,\"'...--'-,,-.!-.!,,.',\"\".\"\"-.,..,,\"\",.\"\".,,.\"\",;,\"\".,,-\"\"\"\",\"\",,....,-.\"\"..,\"\".\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\",,\"\"\"\",\"\".\"\".\"\"\"\"\"\"\"\".\"\",,\"\".,,\"\".\"\"\"\"\"\"\"\"\"\",....,-\"-,,.,,,,,,,,,.-.,-,.,-,.,,,,,,-.,,.,,,.\",\".\"\"\"\"\"\"\".,-,\",,...-..\"\",.\",,..\"\"\",.\"\".\",,\",.\",,.,,\",.,--.,.,,.\"\",.\",\".,.,.'.\"\".\",\"\",,\",-,.\",\"\",..\",-,,..\",.\"\",-..,\"\".\"\".\"\"\"\"\"\",.\"\"\"\",,'.,,;,,\"\"\"\"?..\"\",'\"\".,\",,,.\"\".\"\".\"\".\"\".,,.-,,.,,,.,,..\"','\".\"\".\",\",,,-.\"!!\".\",,\"\",'\".\"',\",.,.-,,'.\"\",\"..,,\".'.!,,,!,,,,-,-,--,.,.\"\",\",,.\".\"\".\"\"\".--,,'\".\",-,\"\"..,,,,\"\",\".\"\"\";\".\",.!!\".\"\",\".,,.,,.\"\"\".\",,,.\".,.,,.,...,,,-..,-.,,,-.,..\",,.',.',,..\",,,.,,,..,-.,,,.\",.--,,.,,,.\",,,...\",,,.,,,,,.,.,,.'.,.,.,.,.,,,,,,..,.\".,.,,,\"\"\".\"!\"\"\",\".,\"\"\",;\".\"\";\"\",\".\",\"\"\"\".,.,.,.\"\"\",\".,,\".,.-,-,,,.,-,,..\"\";\"\"\"..---\"\",,.\"\",\",,-\"\",.\",.\".,,.\"\"\",\",\"\".,,.,.,\"\"\"\"\"\"\"\",,...,,.,,,,'.:',,,,,.,,,,.,.',,,.;,,-,,,.,,\"\"\"\",.'.'','.',,,\"\",,\"\",.,,,.,,,\"\"\"\"\"\",\"\"\"\"\"\"\"\".\"\"..\".,.,.';,,\".\".-,.,,,,.\"\",.\",,.,,.\"\",\".\"\",\",.,--,.,,,,,,,.\"\"\"\",,-\",.\",,,-,,-..,,\"\",\"\".,,\"\",.,\"..\"\";\"\"\",\"\"....,,\"\",,.\".\"\"-.\".,,.,,.,,-\"\"\"\",-,,,-,.-,.,-.,,,,,,,\"\"-\"\".,,',,'\"\"\"\",-.'\"\".\"\",,;,-.,--.\"\",\",;\",,,,\",,,,.\",.!,\".\"?,?\"'.\",!\",,..\",\",\".\"\",?.\"\"'.\"\"'\".\".,.,,\"\"!\".\",\"\",,\".\",,.,,'-..,\",,,,:\".,,,,-.,-,-,.,.,,,,,,-.,;.,,',,.,,,,.,,.,,\"\"!-\",.\"-.,,.;,.,..,,.,\"\"\"\".,:',..:,'\"\".\"\",,,,.,.,,,.,,\"\",\"\",,,,.',,,,\"\",.\"\",,..,,,,\",.\"'\".\"...'...,.,.,-,,-.?'\"\"\"\"\"\",,,,\"\",,,.,,\"\"\"\"\"\".,\"\"..,.,,.\",-..,'.\".,\",.\",..,.,,.,.\"\",,\",,,,.,,'.-,,.,,-.\"\",\".\".\"\".\".\"\".,,\"\"\".\",.,,\"\",,\"..\",,,,,-\".\"\",\".,,,,\".\",,\".\",?,\"\",\",.\",-,.,,,,,.,.,,\".\".\".\".,\"\"\"\"\"\"\",.,,-.',,,.,-.-,-.\"\".\"\".\"..,\"\"!,.,,'\"\"!,\"\",\"\"?.\"\"\"\"!'.,',.-\"\".\",.\",,'.;,,,..,,\",,.,-,-.\"-.'\"..\",\",.\"-\"\"'\"\",-\"\",\"\"\"\"\"\",;\"\",.\".\",,\",,\"?',\"\".\"\",'.\"\",;'\"\"!',,.;''''''',\"\",\".\"',.',\"\",,','\".\"'\"\"\"\"'\"\"',?,\"\"'\"\",\"\"',.',\".\",\".-,.\",.\",\",'.\"\"\"\"'.'?,,,.,!?,.,.\"\".,,-\".\".\".\",'.,,,'\"\",,'\"'.-.'\"\"..\"'.,'\"\"\".,.-,.\"''',\".\",.,,,,,.-,-.,-\".-,,,,.\"'\".\".'..',?\"\";\".\",,.\"\"\"\",,.'.\",.\"!\".\",\",.,-.\",?\".\"\",\".\"\"??\"\".'\"\"\"\",..,,,.,,,.\"\",,\".\"\"-.\"--\".\",,\".\"\".\",;\".\"\".\"\",\"\"\"..,\"-,-,.,-.,,,,.\"\".\".,..-..,!\"\",\"\",,.,-,\".\",\",\"\"\"\"\"\"\",.'.-,.\".-,,,,-.,.\"',\".\",,'!,.'..!.,\",,.\",,.,.,,'\"\"\".\"-'-.,,;.,,.,,,.,?'--.,,-,,.-\"'.\"',\".\"!!.!..'.,'!','\"\"\".\",\"\",..,.\"\"!..,?,\".\",\".\",,..,,'.,,.;,,.,;..\",,.,,.,;,,..?.,.,.\",.,.,-,,.,,.,.,..','.'','',''',''-',.'.'-,,,'',';','''','''.',''.',',.','','',.'\",,.,.,.,.,,.,',..','.'',''''',''',''',;-,'\",,,;,.-.,...-,.!\",.,'-..\"\".\",!,\"\".\".,,,.\",\",,\".;,.,.;.,-.,.,.,,,,\".,,,,;,,,.,,-.,.,,.,..',,.,,-,,,.\",\",\"'..,,\"\",-\"\";.,.-.,,,.,,,.,,\"\",\",,,.-.,,.\"-,\".\".,.,.!..,,\"\"\",.\",\"\",..\",,,,.,,.,-.\"\",.\",.,\"\",\"\",.,-,,\".\",\",.\"..-,-\"\",\".\",,.,;.-,,,,,.,.;.,..,,,,?,,,\",,-,.\"\".\",;.,.,,.,;,.\"\"\",\",,,.,.,.,.\"\",\"\",,,,\".\"\".\",,.,,,.,---,.,;,,,,,,,.,,,.,.\".,.,-,.,'-.--.,.-...,.\".,,.,',,.,-,,,,.\",.,-,,.,,,.\".,.,,\"\",\"\",.,,.,,,',,,'.,-,.;,\",.\"\".\",.-,,,.,-..',',.,.\"\"\"\"..,,.,,,,.',.',',''''.',,''.'',,,.,.-,.'',.''.,'','',,',,\"\"\".\"\"\"\"\"\"\".\"\".\"\"..,,,..,.,,.'.,,.,,,.,',.-,.-,,,.,.,.,,',!!!',',.,,-.',,,.\"\"\",\"?\"\".,,,\"\"\"\",-.,-\"\"..\"\",.',.,-,.,,,.,.,,.,\"\"\"\",\"\",\"\",\"\"\"\",\"\",-\"\",,.\".\"\";\"\"\",.,,,,.--.,,.,.,,,.,,,,,.,.,,,,-,,,\"\"\".\"\"\",\"\",.\"\",\"'.,,.\"\"..\"\",\"\",.\"\".\"..-,\"\",-.,.,,\"\".,\"\"\"\".\"\".',\"\"..\"\",..\".\",\",.\"\"\"\"\",,,,\"\",,,\"\"\"\",,',,,,,,\"\",,\"\"\"\"\"\"..,.\",.,-,-,,-.,.,,,,,-,-,,,,.\"\".\",;\".\".,\"\",\".\"\"\"...\"\"\".\"\".\"\".\"!,\",-.\",!.,\".\",\".\",--\".\"\".\",\"\".'..!!\",,.\"\",.\"\",.\",\",,.\"!,,.,,,',\"'.,.\"\".\".,',,,.,.,,,,.',.,,,;,..'..-,,\",.,.,..,,,,.,,,,.\"\".,.-.\"\".\",,.\".\"\";\"\"\"'\",;\",',-.,\"\",,\",.\",\",,.\"\",\",..-,.\".\"\",.\"..,\"\"'\",..\"\",\",\"\"\"\".\"\",.-.,'.,,\",-,,,.,,.,-,,,.,-,.-.\",,,',.'\"\".\"\",.,\"\".\"\"!.,.,\"\",.\"\",.,\",,,,..,,.\"\",,\"..,\".,,,.,,-.,-,--.,-,.,-,.,,.\"\"-,.\"'\"\"\"\",\"\",\"\",.\"\",-.\",.-..-.\",'\".\"'\"\",..\"\"!\"\"\",.\".,,,,\"\"\".\"-\".\",\"\"--,.,,\".'-,.-,,,,,,..\"'\",.\"'\"\"!,\"\",.\"\"',\"\".\"\",\".\";'.\"\",,!,,,.\".\".\",.\"!\".,,.\",\"\"'.'\"\",?,!',.,,\"'.,.\",\",\"\"\"\"\".\"\"\"\",\".\",..\"\",\"\".\"\"\"\",,.,,,,.,,\"\",,\"\"\"\"\"\",\"\",.,\",'.\"\"\",','\"\"\"\",\"\",..,,..-,,,\"-.,,..,.,'.,-.\",\",\"-.\"\"\"\"\"\"\"\"\"\".\"\",.\"\"-,\"\",\"\",.\"\"\"\"\"\",,..'.,.,'.\"\"\"\",.,,.\"\"\"\"\"\"\"\".\"\"\"\".-,-\"\"\",\".\"\"....,,,.;'\"',.,,,,.\"\",;\"\",,.,,.,.,,,,.\"\";\"\"...\"\".\"\".,;.,',.,,..,:\"\".\".\".\";..,\".,..,.?,,-,,.,.-,,.,.,!,,.,,.-.,,..-,,.,,,-.\",\".\"\".,,.,,..,.,,.,,,.\"\".\"\".\",,.,.'\"..,,..-,,.,,.-,,..,.,,..\"!\"..,-.\"\";\"..,,,.,\"-',',',,..,.,,..\"\",\",,.,'',,,.,,.,,,-.,,.,,..,,.-,,...,,.,.,,.\".,.,,..,.,\"\"\"\".,..',\".',.,,-.','.,,.,,,,,-,.,.',,.,.,,.,,.,',-.,,.,,,.\"'\",;\"'\"\",\",.\"'\".\"';'.,.,;,\",,.-..,.,--,,,;,.\",\",\".,,.,-\".\".,,,(.\",,.\"\",-.\",,\"\",\",.,,,..\"\";\"\".,..,-.\"\".\".\",.\"'\".\",,,\"..,..\"\",\".\"\",.,.,\"\"!\"\",,\"\"\",,\"\"\"\".\",\"\"\"\"!\"\"\"\"\",,,.,.\"\".\"!,.,\"\".\"\",,.;,,,,,;,,\"\"\",\",,.,\"\",\",\",.\"\"'.'\"\"\"\"'..\"\";\"\",\",,,.,,--,-,,.,,.,,.\",.\".\",.,\"\"\",\",.,\",-,,.\"\",\",.,&,-,.,,',.\"..,..,,,,.\",,,.,,''.,,..,.,,,,.,,,.'.',.',.,'\",.''',.''';'.''..,-,,''',''\",.','.','',,?,''''',..''',.''.'.\",..',';'',.'''.'''','...''''.-'''',.,.:'''''','',.''..'',-''.''.,,.,,,'\",.'','.,,''...''''.'-,''''--.'-.,,,-,,.-.,,.,,.,.,,,.,,,,,,-.-.'''.''-,,,''','.,..,.,'.',,:''''',,,,,.\",,,.,,,,.,,'-,.,,,,,.\".,,-'.,.,,.,.,-,\"\"\".\",\"\"\"\",-.\"\"-\"\",\"\"..\"\",.,,,,.,,,.,.,,.,,.,,-,.,,,.,,,.,.\",.,,.,,,.,.,.,,,,.'',.,,,,..'',.\",,.,-,,,..,..,,---??,,,,,.,,,,,.,,.,-.\",,.,,.,.,,,,.'',,,;'..'',','.'''.';',,,.'',''\",.-,,.?,?,,.,,,.,.,,.\",..''.',.''',''\".','.'.'','',,'','-'',...'\",,.,,,,,.,,,.,,,.,-.\",.,,.,.'',',.,.,.,,.'\",.,.,,,,.--.,,.,.'-,.,,..''.\".''-';''\".,.'','',,.,,.''.'!!'\"....,,,,,.,,,.,.,,..,.,;,?,.\",.,,..,-.,,,.\",,,..'!'.'..,-,'\",,..,,.'.,.''.','\",'.,,.,.,.-,.,;.'!','..!,'',',.'..,',,,.,,.,,.\";,.,,,.,,,,.,,-.\".,,.,-.',.,,.,,,,.,.\",..,,...?,.-?.\",..,,.\"..\"\".\".:',,.,-,.',.',.!,\"\"\".\"\"\".,,--.,,\",.,,,,-,..\"\".\"..,,\"\"'\"\"\"\".,,\"\"\",\".'\"\".\"\",\".\",,\"\"\".\",\",\"!,,.,\"\"\".\"\"-.\"\"\"\",\",\"\"\",;\"'..\"\"\"\"'\"\",,.\".\"\"\"-\".\"...\"\",\".\"\"\"\".\",\"\"\".\"-.,,.,,\",..\"\".\",\"-.\"\"\",,,\"\"\"\".'\"\"\",\".,,,\"-.\",,.,'-.,,,,\"-.,,,-.\"'\",.\"-,-.\"\",\",\".-,,,.,\"',,,.,,'.,-.,,,,,,,.-,,.,.,.,,,.\"\",\"!-,\"\"\",.\",;\"..,,.,--.,,,,.,,.,,,.-,,,,'.\"\".\",,--\"\",\",,\".\".\",,,\"\",\"\",\"\"\"\"\"\",\"\",,,.,,.,\"\"\",.\"\"\",....\"\",,\"\"...,.:'.--.,,..,,,-,.',,,,.,.'\",,\".\"'..\"\",,.,\"-.\"\",.\"'.,'!':,.''-,.-.,,.,.!,.,\"\"\",\",.,,\"\",.-,,.\"\".,,,:'',',,,.,,,.,,,..'\"\"\",,.\".,:',-....,',,.,,,,.,.,'\"\"\",.\",;.,.',,,..-,-,',.\"\"\".\"\"\",\"\"\"\".;,\"\";\"\",;.\"\"\"\"\"\",,.,':'..,,;.,.',.',,,,.,,,.(,..,,.,,,...,,,.,,,,.,,.,.,,,,.,,.,,,,'\"\"\"\",\"\"-\"\",,.,.,-\"\"..,,,.,,,\"\".\"-,.,,,-,,,-.,,.,,-,.,,,-,,,-,-.,,.\"-,.\",.\"-.,..,\"\",,...,,\"\",\"\"\"\"\"\",!.\"\"\"\"!\"\"\",\"\"\"!!!'.,\"\".,.-,,\"..\",,\"\".\"\"\"\"\"\",\"\"\"\"\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..,,\"\",'-'\".\",.\",\".,.,,,.-,..,---\".-\"\"\"\"\".,,,....\",,\"\",.,,\"\",,\"\".\"\",,,\"\"\"\".\"\"\"\"\"\".\"\"!.\"\"-\"\"\"\",,.,\"\",\"\",..,.',,.,;,,\"\"!.,\"\",.\"\"'\"\",;,-..\"\".,,.-'\"\"\"\"\"\".\"\"\"\"..,,\"\"\"\",.\"\"\"\".''.\"\".\"\"-\"\"\"\",..,,,,.\"\",,,,',,\"\".,,.'\"\",.,\"..\"-..,,,..,-.,,,..',,,,,,.\"\"\"\",,\"\"\"\"..,,.\"\",\"\",\"\".\"\"\"\",.\"\",,,..,,,,\"\",\"\",,-,-\"\",\",.\",.,.-\"\"\"\"..\"\"\",.\"\"\"?\"\"\"\",,\"\"\"..\"\",,-.\".\",.\"-.\"\"\"\",,,..,,'\"\"\"\",,-.,-.-,,!-,!,\"-,,..\"',\".\"\"\"...\"\"!\"\"?.\"\"\"-.\",\"\"',\"\".\".\"\".\"?\"\"\".\"\".\",,\"\",!\"\"\"\"\",-,',.\"\",-.\",\"\",\",.\"\"\".-.,\"\",'.\"\"\"\"\"\",,\".\",,..\"\"\"\".-.-.\".\":'....'.,,,,.,,\"\",\",.\".\",,.\"\".\"!\"\".\".\"\",\"'\"\",\"\"?'!\"\",\"\"'.\".'.,,.,,.,,'\"\".,.,,,\"\"'\",.\".-,.,\",,.\",\";\"...,,\".,,,..\"\",\",,\"',,'.,,,-.,,.,,,.'.,.\",\",.\".\"\",\".\"..!\",,.\",\".\",.\"\"\"..\"\",\"\"\".\"\",\"\".,.,\"\",,\".,.\",\"\".,\"\"\".\",.,.,\".\".\"\"...,,\",-,.,.,,.\"',\".\",\"\"\"..\",,;,'.'\"\",.,\"\"\",\"'.,\",,,-,.\"'\".\"',',,.,;,.;','.',;,.,.,,..'',',';'',,,,;,.\",,.','.,.'.,..',,,,.\",.,'.',..,,.;,,.'.,.'.?,,.,.,..,.\",,.,..,..'..,,..--.,,.,,',,,\"\"\".\"\"\",,-,,.-.-,,.-,,.,,,,..,.,,,,\".,.\"\",\"\"\"'?'\"\",,\".\"\",\"\"\"\".\",.-\".\"\".\",.,--\"\"\",\".,,,.\"\",\"\",,,.,,.?,.,?,.,,.,?;.,,..'.,',,,--'-.,-\"\"\"\",.,,,\"\"\"\"...,.,,,,.;,,..,,,\"\"\".\"\"\",\",,\",,,...,\".\"\"-,\".\"-,.,,,.,--.,,.,.,,,,,.,-,,,--.,,,.,,.\"\".\"\"\"\",.\"\"\";..!\",,,.,,,.,.,,.-,,,.\",\".\".,\",.,,.\"\".\"\".\"--,.,.;,,.,.\"\",\",\"\"\"\",\".,&,\".,,?,,.\"\";\"-.,.,.,.\",,.,.,,,.\".,-,-,,.,,,.'.',''''.'',',.,,,.''',,'.',,.''','.,,,,,''',,.''''.'',,,-,.'-','..'\".''.'.-''....'''',.,,.,,.,,.,,,'\",,,.,,,.,,..,,.\".',?,!,,,.,,.-.\",.,.,.-.,,-,.,,..,.\"..,.,.-.......,.\",.,,,,.,,,.,,.,,,.\",,,,.,-,,,,.,,.,,,,'.\".;,.-,,,,....,,.,;,!-!\",.,,.\"-,,,.,,,,;.,.''.''',''.''.',.-'\",.,,.',',''','.'''',','','.','.'.,,'\",.'',.\",,.-.,.',',,,,',,-''''.,'',.'','',-',.\",.,,\"\",\"\".,,,.,,.,..,,.,,-.'','!!'\",,,,,.,...,,.'',.'!!'''.',',.'.'.'..?''','.,.'''-.''''.','\",.,,',,,.-.,,,.,,..'','.'','.,,;..'';',.,,''',....;,.,,,....,!,,.,\",.,.\"\".\"'..,\"\"\"\"..\"\"\"\".,.--\"\",,\"\"!\"\"'\"\"\"\".\"\",\"\",,\"\"!..?,\"\".,?..\"\"'\"\"!.,,\"\"\"\"\"\",.\"\",\",\"?;..,,,-,,,,,-,,-.,\"\"\".\",\"\"\";\",,.,,\",,.','.,,.,.,.-,.-,-,.,,'.,,,,.,,',..-..,,,.'.,,,.,,-.,.\",,\".\",,,\"\".'.\"\",,\"\"?\"\",\"\",.,,..\"\"-,!.,\"\"\",.\",..\"\"\".\"?!,,.,,,,\"\",,,\",.\".\"\",,\"\"\"\",.,\"\".\"\"\"\"\"\"\"\"?\"\",-,'\"\".,\"\"\",\"\"\",...,.,\"\";.,,\"\"\"\",!-.\"\"\",\"-,\"\",\"\"\"'.\",\".\"\",',.\"\".\".\",..\"\".'-,,,..\"\".\"--\"\"\"\"-\".\"\".\".,,.\",.',-.,.\",.\",\".\".\"\".\"\",.\"\";\",,..,,.?.\"\".\"\".,\"\"'\"\"\"\"\"\".,.,.,\",,.,.\",.\";\"\"\",..\"\"\".\"\".\"?\"\"\"\",',\"\"-.,,\"\"\"\"..-;\"',.,,...,,,,,.\"\",.\",,'.,---,.\",,.,,-..\"\".\"\"\"\"\",..'\"\"\"\",..,.,.,,\".,.,,.,,.,.,,.\",\",\"\"\",\".\".\",,.,,,.,.\"\".\",...,,\"\"\"\".,,.,,..:'--,.,,,.,;,,,-.,--'\",.?\"\",,..,.,\"\"!!,.;!\"\"\"\"\"\"..,.-?.\".,,..\"\".\"!\",.\",.\".\"\".\",\"\",.,,,\"\"\"\",-,\"\"!\"\".,,,.,,\"\"',,,\"\",.,,:.\"\"?\"\";..-,,..,,.,\"\",,\".\",,.,,,,.,..,.,,.,'-,.\",,.,,,-.,.,-.,,,,.,,,.\".,-.,,,,,,.,,,,.,.,,,,,,\"\"\".\"..,,\"\"\"..\",!!!.\"\"\",\".,.',.,,,,.,,,-,.,,.,;.\",..,,,.,.,.,,,,,.,.,,.\",,,,,...;;;;;,.,..,?\",,,.,,.,?.,,-.,,.\"?,?,....,,.\",.',,,,,,-.\"\"-\"..\"..,.,,..,,.,-.,,..-..',',''',.,.,,','\"\"\",.\",,...,.\"\"\",\".,,,\".\"\",,\".,,,,,,,\"\"\",,\"\"\",\",--\"\"\"\",'.\",\",,,.\",-....\",.-,,.,.,,,.\"\",,\",,,,.,,,,.,\"\"\",\"\"\",,,,,!,,,,.,,.,-.,.-,.\".,:\".--.--.,\"\"\"\".\"\"\"-\"\",\"\".,,.,\"\",.,,,\".,,,',.\",\",,\",,\"\",.\".,,-,.\"\",\",,,,.,,.,'.\"-',.,.,,,.\",,.,..'';'.!'.-.','.','''','''''',,!-',.''',,'.',,,-'','.'.,?.,.,,?,,'\",.,,,.,,,-.'',,','\".,,.','.'..,.,,-'',?''-.,!!!!'.\"','.',',''',,,,'.',,,.,''''.,.,--.,.''',.',,'','''\".,.,,...''.,.''.'',',,,'.''',,'.',;.,.,,'\",.''.','',,,'.'.-,',.\",.,,,.,,..,?.,..:\"',.'--,.,.,,.,..,,,(,,,.,,,.,,,,.,,.,-..,'\",.,.,,\"\",,,\",.\"\"\"\"\",.\"\",..\"\",..,-.,,\"\"-,,.\"\",.,\"\",,-..,?\"\".\"\",...-\"\"!\".\"\".\",,\"\"\".\"..,-,-\"-.\"\",,\"\"\"\".\"\"'.,-.,,,,,,.,,,.\"!!\".\"'\".-,-.,,,.\"\",..\"-\".\"!'.\"\"\",.\"\"\",\"\"-\",.\":\"\".,\"'.,.,,.,,'.,,-.\"\"..\",\",\".,.,\"\"\".\"\"\".,,,\"\"\"\"..,',,,.,,.,,,,,.,..,\"\".\"\".\"\",?\"\",..,,\",,.-,.\"\".\";.\"\"\"\",,..,\"\"\".\",,,-....,\"\"\"\"..,.-.,,,,,,.,,,.,'..\",,.,.,...,-,,,,-.,,...,'.\".....,.,,.,.,..,-.,..,,,.,.,,,\"\"\",\"\"\".,,.,.,,,,,.,..,..,,.\";,..',',,',,..-.,'\".,,....,.-,,,.,.,.,,.,..,,,,,,.,.,.\".,,,.-,,,.,,,,.\",.,.,,,.,.-,,.,,,....,,,,.,.,,...,..'',''','.',''!!'''',,.'\",..,,,\"\"\".\"\"\",,.,..,.''.,.''\",.''',.'',.,,,.,,.,.'',''\",'.,.,,..,,,,,...\".,,,.,,.,,.,.,.,.,..\".,..?,,.,.?,.,.\",,.,.,,.,.,,,.,,,.,,..\",,.,,..,,.,.'',',.'\".'',','\",,.''.'.,!.?',.,.\",.,,.,.-.';'.,,.\".,.,,.,;....,,.,,.\",,.,.,,,.,,,.,.,..,.,,..,-.,,.,.'',,',.'','.'!'--','\"...''.'.,''',.','.'''''.'.'-'',,.--,-'''\"...,...,,,,...,...,,,,.,,,..,',..,,.,.,,,,\".,,.\"\".\"..\"\".-\"\"\"\"\"\",-\"\",.?\"\".\"\"',.,,,..,.,,\"\"\"\"!..,..,,,,.,,,,.,,,,..--,',,,,,...\"\"\".\",.'..',',,,,\"\",.\".\".,\"\",.'.,\",,-.,,-.\"\"..\".\".\".,.'\"\"\".\",\",,,..,.,'.\"\".\",,.,,,\"...,,.,.\"\";\"'\"\"\"\".\".\",\",\"'.\"\"\";\"\"\"...,,\",,.,.\"\",\"'\",.\"\",\"!!,?.'\".\"'\".\"\".\"\",.,,..\"\".\".'.,,'\",.,',.,,.,,.-,,.,,.\".\".\",...,,',\"\"\",.\".\"\",,,\"\",,,\"\"\";\"''.'-,','.\",',.,.'.,,,,.'.;,,.,,.',-,'.,,;',\"\"\",\",..,,\"\",\"\".\"\",\"\".,,,,,\"\".-,-\"..\",\"\",,\"\",.\",\"..,,,,\"..,,.,'..,,,.,,,,,.\n" ] } ], "source": [ "sherlock_punct = [c for c in sherlock if c in string.punctuation]\n", "print(''.join(sherlock_punct))" ] }, { "cell_type": "code", "execution_count": 71, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 171,\n", " '\"': 4834,\n", " '&': 5,\n", " \"'\": 1490,\n", " '(': 5,\n", " ',': 7053,\n", " '-': 965,\n", " '.': 4843,\n", " '/': 1,\n", " ':': 56,\n", " ';': 202,\n", " '?': 138})" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sherlock_counts = collections.Counter(sherlock_punct)\n", "sherlock_counts" ] }, { "cell_type": "code", "execution_count": 72, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "! 171\n", "\" 4834\n", "& 5\n", "' 1490\n", "( 5\n", ", 7053\n", "- 965\n", ". 4843\n", "/ 1\n", ": 56\n", "; 202\n", "? 138\n", "dtype: int64" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sherlock_ps = pd.Series(sherlock_counts)\n", "sherlock_ps.sort_index(inplace=True)\n", "sherlock_ps" ] }, { "cell_type": "code", "execution_count": 73, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD9CAYAAABZVQdHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFPhJREFUeJzt3W2MXNdh3vH/I7FKKJkNwbpdkZRSC/Ey0rZ2I7MVnSaF\nxk3KbvoiEgVCUkgFoqaNCkwjt2iDLo22XH9xJfeVRkEVrZ1omVoM2DgR5JqmuWI4TeEg2tqRbcY0\nTbLIqt51dpXaceQ0aUNGTz/MoT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69NOX14qkPwE8DvwB8DHbr/by/O3W2mfXbADe0vbY\n0Lbvzn50KOlseXyyH+dfwuckPSdpL3C6Hx1I+s3yeLEf51+gKemnJW3rMI7vL++A/q8DGMd/Ar4m\n6V8OoK+TA+ijk4/3+oSS/qLevLeQL7yenl/fDc7br9fKJ4G7gHuAX5P0fT0+/+uyXLMESX+6FP/I\n9kyf+7oL+MPyRrFrdQdpvUt4n+0T/ey/3yR9F/ATwKPAnwW+A4jWD+zfAD4BPGv7DwcwltuAB2x/\npc/9vGT7wX72MSiS/j2t97VcBD4DnKrpt4Ub6cdrRdKXbb+zlP8q8DHg28A/At5n+8d71ldCfnGS\nfrMUX7Hd1zduldn0btu/Vbb/FvAvgJ8CftL2X+9n/4NUPuLirWXzf9n+ozdzPP0i6aDto2/2OHqp\nfBTJjwE7gY3ALwOngM/V+jz2mqTPAT9he7ps3wZsAb4FbLT9jZ71lZBfPSR9yfafK+W/C/wT4Eds\nX5T0Bdvb39wRRryRpDuB99AK/R/Ma7Q7ku6ndU/xa33vKyG/ekg6S+vDMu4F3gv8ZdtNSX8KeOHa\nr3cREd1aazdea/fjwGu01jz3AB+XNAH8KvDUYgdGRHSSmfwqJmkr8EPAlwbxa11E1CchHxFRsSzX\nRERULCEfEVGxhHxERMUS8hERFUvIR0RU7P8BnaAgGCuaansAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "sherlock_ps.plot(kind=\"bar\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can read and process a novel, wrap that into a function and read some other novels" ] }, { "cell_type": "code", "execution_count": 74, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def punct_summarise(fname):\n", " content = open(fname).read()\n", " punct = ''.join(c for c in content if c in string.punctuation)\n", " counts = collections.Counter(punct)\n", " return {'punctuation': punct, 'counts': counts}" ] }, { "cell_type": "code", "execution_count": 75, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 171,\n", " '\"': 4834,\n", " '&': 5,\n", " \"'\": 1490,\n", " '(': 5,\n", " ',': 7053,\n", " '-': 965,\n", " '.': 4843,\n", " '/': 1,\n", " ':': 56,\n", " ';': 202,\n", " '?': 138})" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Complete Sherlock Holmes\n", "sherlock = punct_summarise('sherlock-holmes.txt')\n", "sherlock['counts']" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 3923,\n", " '\"': 17970,\n", " '#': 1,\n", " '$': 2,\n", " '%': 1,\n", " \"'\": 7529,\n", " '(': 670,\n", " ')': 670,\n", " '*': 300,\n", " ',': 39891,\n", " '-': 6308,\n", " '.': 30805,\n", " '/': 29,\n", " ':': 1014,\n", " ';': 1145,\n", " '=': 2,\n", " '?': 3137,\n", " '@': 2,\n", " '[': 1,\n", " ']': 1})" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "wap = punct_summarise('war-and-peace.txt')\n", "wap['counts']" ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 10815,\n", " '\"': 6,\n", " '&': 10,\n", " \"'\": 27942,\n", " ',': 82750,\n", " '-': 4590,\n", " '.': 36881,\n", " ':': 10649,\n", " ';': 17400,\n", " '?': 10327,\n", " '[': 19,\n", " ']': 18})" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Complete works of Shakespeare\n", "shakespeare = punct_summarise('shakespeare.txt')\n", "shakespeare['counts']" ] }, { "cell_type": "code", "execution_count": 78, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 1576,\n", " '\"': 8,\n", " '%': 3,\n", " '&': 3,\n", " \"'\": 4485,\n", " '(': 1777,\n", " ')': 1788,\n", " '*': 90,\n", " '+': 2,\n", " ',': 16349,\n", " '-': 5037,\n", " '.': 21361,\n", " '/': 58,\n", " ':': 2564,\n", " ';': 34,\n", " '?': 2235,\n", " '_': 4566})" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ulysses = punct_summarise('ulysses.txt')\n", "ulysses['counts']" ] }, { "cell_type": "code", "execution_count": 79, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "Counter({'!': 500,\n", " '\"': 3553,\n", " '#': 1,\n", " '$': 2,\n", " '%': 1,\n", " \"'\": 748,\n", " '(': 38,\n", " ')': 38,\n", " '*': 58,\n", " ',': 9280,\n", " '-': 1193,\n", " '.': 6396,\n", " '/': 26,\n", " ':': 155,\n", " ';': 1538,\n", " '?': 462,\n", " '@': 2,\n", " '[': 1,\n", " ']': 2,\n", " '_': 808})" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pap = punct_summarise('pride-and-prejudice.txt')\n", "pap['counts']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Place all the counts into a Pandas dataframe, normalise them, and then plot them." ] }, { "cell_type": "code", "execution_count": 80, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
papshakespearesherlockulysseswap
!5001081517115763923
\"355364834817970
#10001
$20002
%10031
&010530
'74827942149044857529
(38051777670
)38001788670
*580090300
+00020
,92808275070531634939891
-1193459096550376308
.63963688148432136130805
/26015829
:155106495625641014
;153817400202341145
=00002
?4621032713822353137
@20002
[119001
]218001
_8080045660
\n", "
" ], "text/plain": [ " pap shakespeare sherlock ulysses wap\n", "! 500 10815 171 1576 3923\n", "\" 3553 6 4834 8 17970\n", "# 1 0 0 0 1\n", "$ 2 0 0 0 2\n", "% 1 0 0 3 1\n", "& 0 10 5 3 0\n", "' 748 27942 1490 4485 7529\n", "( 38 0 5 1777 670\n", ") 38 0 0 1788 670\n", "* 58 0 0 90 300\n", "+ 0 0 0 2 0\n", ", 9280 82750 7053 16349 39891\n", "- 1193 4590 965 5037 6308\n", ". 6396 36881 4843 21361 30805\n", "/ 26 0 1 58 29\n", ": 155 10649 56 2564 1014\n", "; 1538 17400 202 34 1145\n", "= 0 0 0 0 2\n", "? 462 10327 138 2235 3137\n", "@ 2 0 0 0 2\n", "[ 1 19 0 0 1\n", "] 2 18 0 0 1\n", "_ 808 0 0 4566 0" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "punctuation = pd.DataFrame({'sherlock': sherlock['counts'],\n", " 'wap': wap['counts'],\n", " 'shakespeare': shakespeare['counts'],\n", " 'ulysses': ulysses['counts'],\n", " 'pap': pap['counts']})\n", "punctuation.fillna(value=0, inplace=True)\n", "punctuation" ] }, { "cell_type": "code", "execution_count": 109, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 109, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfoAAAEECAYAAADAjfYgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8VNW5//HPQ7grCQjILWBA8QJ4iopUEWSwYtEiWBTl\nImK1VrQq1NZaPKLBeqSKClU5UlpFq9YLtSh4wdRCEIqioCLoEX6gAgKCaLgUkATy/P7YkzgZMsmQ\nC5kZvu/Xa15k9l5r7bUnQ569Lnttc3dEREQkNdWq6QqIiIhI9VGgFxERSWEK9CIiIilMgV5ERCSF\nKdCLiIikMAV6ERGRFKZALyIiksLiCvRmdr2ZfW5me8xsiZn1jDNfRzPbaWY7o7aHzKywlNfxFTkJ\nERERKV25gd7MLgMmA3cDXYFFwOtm1racfHWB54D5QKxVeToBLSNeq+OuuYiIiJQrnhb9zcB0d3/M\n3Ve6+03AJuC6cvLdC3wIzAAsRpqv3X1LxKsw7pqLiIhIucoM9OFW+alATtSuHKBHGfl+AvwEuJHY\nQR5giZltNLM3zSwUV41FREQkbuW16JsBacDmqO1bCLraD2BmrYFpwHB33x2j3I3AKGBQ+LUS+Fe8\nY/8iIiISn9rVUOZTwKPu/l6sBO6+ClgVsekdM8sCbgEWRqY1Mz11R0SkAty9rB5VOUyU16LfCuwH\nWkRtb0EwTl+aPsCdZlZgZgXAX4Ajwu9/Xsax3gU6lrbD3WO+7rzzzjL3V3W+ZDtmstVXx0zMvDpm\n8h1TpEiZLXp3zzezpcB5wIsRu/oSTLIrTZeo9xcB/w2cTtBlH0vXcvaLiIjIQYqn6/5B4Ckze5fg\n1rp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mVOx0REUlWtWrVKvEE\nuCuvvJJx48YdkG7ixIlccsklJbbddNNNjBkzBoAnnniCY489lvT0dDp06MDf/vY3IHh+fO/evWnc\nuDHNmzdnyJDv25affvopffv2pWnTppx44onMmDGjeN9rr71G586dSU9PJzMzkwceeKBKz7u6xTUZ\nz90fJVj4prR9Pyvl/QEr4ZWS7y3gtHiOLyIih59Y3f6XX34548ePZ/v27WRkZLBv3z6ef/555syZ\nw65duxg9ejRLliyhY8eObN68mW+++QaAcePG0a9fP+bPn09+fn7xo2x37dpF3759ufvuu3njjTf4\n6KOP6Nu3LyeffDInnngiV199NX//+98566yz2L59e8I+jjYWrXUvIiIJq7SJg61ataJXr17Fre45\nc+bQrFkzTjnlFCDoGVi+fDl79uyhRYsWdOrUCYC6devyxRdfsGHDBurWrUuPHsFd36+88grt27dn\n5MiR1KpVi65duzJo0KDiR9LWrVuXjz/+mB07dpCRkVF8nGShQC8iIkln5MiRPP300wA8/fTTXHHF\nFQAcccQRPP/880ydOpXWrVvTv39/Vq5cCcB9992Hu9O9e3e6dOnC9OnTAVi7di2LFy+mSZMmxa+/\n/e1vbN4cLOny4osv8tprr5GVlUUoFOKdd96pgTOuOAV6ERFJCA0bNmT37t3F7zdt2hRzxv7AgQP5\n6KOPWLFiBa+++irDhw8v3nfeeeeRk5PDV199xYknnsg111wDQIsWLZg2bRobNmzgT3/6E9dffz1r\n1qyhXbt29O7dm7y8vOLXzp07mTJlCgDdunXjpZde4uuvv+aiiy7i0ksvrcZPoeop0IuISELo2rUr\nzzzzDPv372fOnDm89dZbMdM2aNCAiy++mGHDhvHDH/6QzMxMALZs2cLLL7/Mrl27qFOnDkcccQRp\nacHK6jNmzODLL78EoHHjxpgZaWlp9O/fn1WrVvH0009TUFBAQUEB7733Hp9++ikFBQU888wzbN++\nnbS0NBo1alRcXrJQoBcRkYTwxz/+kdmzZxd3nf/0pz8tsT+6dT9y5EhWrFjBiBEjircVFhYyadIk\n2rRpQ9OmTVmwYAGPPhrMJV+y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fvYiISApToBcREUlhCvQiIiIpTIFeREQkhf1/BmYtWNLZ\nUuUAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "punctuation_normalised = punctuation.div(punctuation.sum())\n", "ax = punctuation_normalised.plot(kind='bar', fontsize=14)\n", "ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Too many types of punctuation with very low counts. Let's just look at the most common punctuation." ] }, { "cell_type": "code", "execution_count": 108, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAegAAAD/CAYAAAA69EWbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X10VNX97/H3TsKTShIeQgwkMQGiCNhCa1HRNAkVGvrj\nqQqWIAEq1eu1omhrlVsxscsfPiCV4mVVuS2gggVpCwREjL+SUSz1AVrQUCErUAMkSEVDghGSQM79\nI8k0hDxMZuZkziSf11pnrcmcc/Z8Z2dmvmfvs8/ZxrIsRERExFlCAh2AiIiIXEwJWkRExIGUoEVE\nRBxICVpERMSBlKBFREQcSAlaRETEgcLsKtgYo+u3RES8YFmWCXQMEni2tqAty3LUkpWVFfAYFFPH\niksxKSZ/LyL11MUtIiLiQErQIiIiDtSpEnRqamqgQ7iIYvKcE+NSTJ5RTCJtZ+w652GMsXQ+RUSk\nbYwxWBokJnSyFrSIiEiwsO0yK6g9Euyo1DsgIiJ2sjVBk5dna/EBk5YW6AhERKSDUxe3iIiIA9k6\nSMyWgh1CXdwiYgcNEpN6tnZxZ2VluR+npqbqsgYRkUZcLhculyvQYYgD6TIrEREHUQta6ukctIiI\niAMF9WVWaqGLiEhHZe9lVtiZQNUDJCIiHZfNCVpJVERExBttStDGmHjgnzTfNL7asqxj9X+oC1pE\nRMQ7bRr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hzNkyBB27NiBMYaqqipmz55NeHg4w4cPZ8+ePe59\nnnrqKQYPHkx4eDjDhg1j06ZNzZb/0EMPkZyczOnTpykrK2Pu3Ln079+f2NhYFi5cSE1NDQCFhYWk\npKQQGRlJVFQU06dPd5cREhLC888/z6BBg4iKiuIXv/jFBQcRK1euZOjQofTu3Zv09PQLpsK8//77\niY+PJyIigmuvvZZ3333XvS47O5upU6eSmZlJREQEL730UosxtoUStIiIeO3gwYMsX76c3bt3U15e\nTm5uLgkJCViWRU5ODhkZGZSVlTFp0iTuvfde936DBw/m3Xffpby8nKysLGbOnMmJEycuKNuyLO68\n807y8/N566236NmzJ3PmzKFr164cOnSIf/zjH+Tm5vK73/0OgIULF5Kens6pU6coLi7mvvvuu6C8\nTZs2sWfPHv7+97+zefNmVq5cCcDmzZt58skn2bhxIydPniQ5OZmMjAz3fqNGjWLfvn2UlpYyY8YM\npk2bRlVVlXt9Tk4O06ZNo6ysjBkzZrQYY1soQYuIiNdCQ0OprKxk//79VFdXEx8fz8CBAwFITk4m\nPT0dYwwzZ85k37597v2mTp3K5ZdfDsBtt91GUlIS77//vnt9dXU106dP59SpU2zZsoXu3btz4sQJ\n3njjDZ577jl69OhBVFQU8+fPZ926dQB07dqVTz/9lOLiYrp27cro0aMviPXhhx8mMjKSuLg45s+f\nzx/+8AcAXnjhBRYsWMBVV11FSEgICxYsYO/evRw9ehSA22+/nV69ehESEsKDDz5IZWUlBw8edJc7\nevRoJk2aBEBZWVmLMbaFErSIiHht8ODBLF26lOzsbKKjo8nIyOD48eMAREdHu7e75JJLOHv2rLur\n9+WXX2bkyJH06tWLXr16kZ+fzxdffOHevrCwkC1btvDYY48RFlY7XKqoqIjq6mpiYmLc+9199918\n/vnnADzzzDNYlsWoUaMYPnw4q1atuiDWuLg49+P4+HhKSkrc5d5///3uMvv06QNAcXExAM8++yxD\nhw4lMjKSXr16UVZWxsmTJ91lxcbGuh+3FmNbKEGLiIhPMjIy2LlzJ0VFRRhjePjhh1scxV1U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trGCi6SZFRMQnTz/9NLGxsYSHhzNkyBB27NiBMYaqqipmz55NeHg4\nw4cPZ8+ePe59SkpKuPXWW+nXrx8DBw7k+eefd6/Lzs5m6tSpZGZmEhERwUsvvXTRa+bk5DBs2DB6\n9epFWloaBw4ccK87evQot9xyC/369aNv377MmzevybgfeughkpOTW5ydKpCUoEVExGsHDx5k+fLl\n7N69m/LycnJzc0lISMCyLHJycsjIyKCsrIxJkyZx7733AlBTU8PEiRMZOXIkJSUl/OUvf2Hp0qXk\n5ua6y83JyWHatGmUlZVx++23X/CaBQUFzJgxg2XLlnHy5El+8IMfMHHiRM6dO8f58+eZMGECiYmJ\nFBUVUVxcTEZGxgX7W5bFnXfeSX5+Pm+99Rbh4eH2V5QXlKBFRMRroaGhVFZWsn//fqqrq4mPj3fP\nGJWcnEx6ejrGGGbOnMm+ffsA+PDDDzl58iSPPvooYWFhJCYm8pOf/IR169a5yx09ejSTJk0CoHv3\n7hd0ma9fv54JEybwve99j9DQUH7+859z5swZ/vrXv/LBBx9w/PhxFi9eTI8ePejWrRujR49271td\nXc306dM5deoUW7ZsoXv37u1RTV6xeZCYiIh0ZIMHD2bp0qVkZ2ezf/9+vv/97/PrX/8agOjoaPd2\nl1xyCWfPnqWmpoaioiJKSkro1auXe/358+f57ne/6/47Nja22dcsKSm5aE7muLg4iouL6dKlC1dc\ncQUhIU23PwsLC/noo494//33CQtzdgpUC1pERHySkZHBzp07KSoqwhjDww8/3OKo67i4OBITEykt\nLXUv5eXlbN26FahNuC3tP2DAAIqKitx/W5bF0aNHiY2NJS4ujiNHjnD+/Pkm97366qtZuXIl48eP\np6CgwMt33D6UoEVExGsFBQXs2LGDyspKunXrRvfu3QkNbfnWGKNGjaJnz54888wznDlzhvPnz5Of\nn8/u3buB1keAT5s2jddff50dO3ZQXV3NkiVL6N69O6NHj+Y73/kOMTExPPLII3z99decPXuWXbt2\nXbD/9OnTWbRoETfffDOHDx/2rQJspAQtIiJeq6ysZMGCBURFRRETE8PJky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asoIaruV7IjJE17XlY0xNcXWejLGfJfaRJhlWdayJjZp93ryIKamtPfnKZTa73n9dz0Q3z1P4mqK\nnXU1HPhmg+Ux4Ezd4z/WbdPenylPYmqKR/UkQai1UWTUdktVUnupwNXUXnJQTt2lAsCTwP802D6c\n2iPEPwDDqD1PUgY80GCbBOArakcrXk3t5QuVwA89Hd1mU1zzgcnUHo0OqyujBphiR0x1zw2l9gu2\nDviQ2i/jCH/VlU0xtWs9UTtytYLaUbXR1LZqLgeiAlVPHsbU3vWUCUyl9hKcgXX7HwPWBPi750lc\n7f7da7T/HC4eMd2unykPY/KpnrQE1+LZRrWXKP0LOEvtD/ZNDdatAg432n448Da1R3/F1Hb/NS7z\nu9QeYZ4FDgF3tTl4P8dF7XmcAuBr4Iu6bdNtjulfdV+wGmq7xGqA8/6sK3/H1N71VPf3+QYx1S+N\n4263evIkpgDU0/S6919O7fW2+dR2JXdrVGa7fvc8iau966qJfefQ6JrjQHz3WovJH/WkJXgWzWYl\nIiLiQLoXt4iIiAMpQYuIiDiQErSIiIgDKUGLiIg4kBK0iIiIAylBi4iIOJAStIiIiAMpQYuIiDiQ\nErSIiIgD/X9zx531pAILaAAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ax = punctuation_normalised[punctuation_normalised.sum(axis=1) > 0.1].plot(kind='barh',fontsize=14)\n", "ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Visualising the punctuation\n", "Let's print the punctuation sets side-by-side to compare them." ] }, { "cell_type": "code", "execution_count": 83, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ".\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".''''''''' ,.\",\",\"'..?\"\".,\",,\",,,.,..?.?\"\",\".\",\",,\"?.\",..\",\",\n", "''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',. .,',.',..,,(),:\".?.\".\",\",--\".?',.',\".\".,'.\".\"',\".\"\n", ".\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.- .\"\"';.?\"(),\"'....\",,..\"?\".\",.,..\",.\"?,\",.\"...'!\",.\n", ",-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\" .\"?\".\",',.,.\",,,.\",\",,\"?,\",\",?\":\"'....?\"\"..-,'.',.\n", "\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\". .;,.--'.\"\",,\",'.\"-,.'.\",',,,.\",\",,\"',',,.''.\"'.:.'\n", "\"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,! ,,';.,,*.,,.',,,..*.,\",\"\"?\",,;,'.,,;.,,,\",,.\",,.-.\n", "-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\", ,,,,.,-----.,,,.,,,,.,,.,,,,,.\",\",.\",,,\",.\",.\"-,-,\n", "!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\" ,.\",,,\".\",\",,\"?.?\",,,.\"!\".,-,,-,,.,-'.,,..-,,,.,,,\n", "\"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\" .\",,,\",.,.,.','.:\"?.\"\",,.\"\"?\"..,.,,'.\",\".,,.,,,,,,\n", "\",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\" -,,,..,.,'.,,,.-..,.'..,,,.,,.,,,',,,..-,..',,,.'.\n", ".',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\" ','.\",!,,\",:\",.\".,.\",\".\",\".\",\";,-..\",,,\",..--.,,,,\n", "\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\" ,,,,----.,.,,.\"!\";.\",,\",...,,,,.,,',..\",'....,?\",.\n", ".\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,. \".\",,.\",\",,.,,.,.',,-,,,,-,.,,,,.\"'?\",,.\",,\",.\",\".\n", ",,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,, -.-,,,,..,,';,',,'.,.,;.\"!\".\"!\",.,,,,.,,'-,.,.\"...\n", ".'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''. ,\".\"----,!\"\"?\".,,.',,.\",,,,\".,,,.:,'.,,,.,,,,,.,.,\n", "',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\" .,',.\",?\".\",\",',\"--....\"\",?\"\".\"\"?\"\",\",,\"!\".,,,.,,'\n", "\"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\". .\"!...,,?\".\",\".\".?\".\",!\",'.,.\",,\",.\"',.,\",.,,,,.,,\n", "..,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\" .\",\".\",\".':\"!..\".'..-.\",?\",.\"'..\",,,.\",?\".\",,,\",\".\n", ",,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\" ..\",,,..,,''.',,;'.\",,\".\",';'--,\".\",',!.,\",.\",,\",.\n", ",,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\" ,,.,,,.',,.;.,----,,,,..\",\",\";',--..?\"\"!--!\".\"--!.\n" ] } ], "source": [ "line_len = 50\n", "for i in range(5,25):\n", " print(sherlock['punctuation'][line_len*i:line_len*(i+1)], wap['punctuation'][line_len*i:line_len*(i+1)])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Again, now I know it's working, wrap it in a function." ] }, { "cell_type": "code", "execution_count": 84, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def compare(text1, text2, offset=0, line_len=50, max_lines=30):\n", " for i in range(offset, min(max(len(text1), len(text2)), line_len * max_lines), line_len):\n", " t1 = text1[i:i+line_len]\n", " t1 += (' ' * (line_len - len(t1)))\n", " print(t1, text2[i:i+line_len])" ] }, { "cell_type": "code", "execution_count": 85, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ",,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\",.,\"\"\",\".,.,'.,,,,,\",. !!\",.,,,,.,,.,,,,,.\",,.',\",.\"??\".\",?\"\"'?.,\".\".\"\"'.\n", "\"\";\",,..,,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\"\"\"\",\"\"\"\" .\"\",,\",,-,.\"'!,'?.\"\"?\",.\"?,.\",.,,.,,.,,,,,,,,.:\",'\n", "?'\"\"!...,,.--,,,\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,. .',,,.!..!,.,!....,,?...'..,,.?.-,.?!!,....',...!\"\n", ".\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".''''''''' ,.\",\",\"'..?\"\".,\",,\",,,.,..?.?\"\",\".\",\",,\"?.\",..\",\",\n", "''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',. .,',.',..,,(),:\".?.\".\",\",--\".?',.',\".\".,'.\".\"',\".\"\n", ".\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.- .\"\"';.?\"(),\"'....\",,..\"?\".\",.,..\",.\"?,\",.\"...'!\",.\n", ",-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\" .\"?\".\",',.,.\",,,.\",\",,\"?,\",\",?\":\"'....?\"\"..-,'.',.\n", "\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\". .;,.--'.\"\",,\",'.\"-,.'.\",',,,.\",\",,\"',',,.''.\"'.:.'\n", "\"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,! ,,';.,,*.,,.',,,..*.,\",\"\"?\",,;,'.,,;.,,,\",,.\",,.-.\n", "-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\", ,,,,.,-----.,,,.,,,,.,,.,,,,,.\",\",.\",,,\",.\",.\"-,-,\n", "!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\" ,.\",,,\".\",\",,\"?.?\",,,.\"!\".,-,,-,,.,-'.,,..-,,,.,,,\n", "\"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\" .\",,,\",.,.,.','.:\"?.\"\",,.\"\"?\"..,.,,'.\",\".,,.,,,,,,\n", "\",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\" -,,,..,.,'.,,,.-..,.'..,,,.,,.,,,',,,..-,..',,,.'.\n", ".',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\" ','.\",!,,\",:\",.\".,.\",\".\",\".\",\";,-..\",,,\",..--.,,,,\n", "\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\" ,,,,----.,.,,.\"!\";.\",,\",...,,,,.,,',..\",'....,?\",.\n", ".\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,. \".\",,.\",\",,.,,.,.',,-,,,,-,.,,,,.\"'?\",,.\",,\",.\",\".\n", ",,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,, -.-,,,,..,,';,',,'.,.,;.\"!\".\"!\",.,,,,.,,'-,.,.\"...\n", ".'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''. ,\".\"----,!\"\"?\".,,.',,.\",,,,\".,,,.:,'.,,,.,,,,,.,.,\n", "',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\" .,',.\",?\".\",\",',\"--....\"\",?\"\".\"\"?\"\",\",,\"!\".,,,.,,'\n", "\"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\". .\"!...,,?\".\",\".\".?\".\",!\",'.,.\",,\",.\"',.,\",.,,,,.,,\n", "..,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\" .\",\".\",\".':\"!..\".'..-.\",?\",.\"'..\",,,.\",?\".\",,,\",\".\n", ",,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\" ..\",,,..,,''.',,;'.\",,\".\",';'--,\".\",',!.,\",.\",,\",.\n", ",,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\" ,,.,,,.',,.;.,----,,,,..\",\",\";',--..?\"\"!--!\".\"--!.\n", "\"\"\"\"\"\"...\"-..,,,.,,,-,.,,,,.;,.,-,,.,,;,.\"\".\"\".\",, ..\".\"...!,...\".\",'.'..\"\",!'!...\"\",\",\".\"\",!-!?\"\"?\"\"\n", "'\".\"'\"\"'\".\"''.,,.,'\"\"'.,\"\".-..,\",.,,.,,..,-.,,..,. ;,'.\"\",,!\",,,-..,.,,..\",?\",\",?!'!.\".\"',!'*,\",:\"''.\n", ".\"\",-,,--\"\".,.,',..\",\".\".\"\"\"\"\"\"\"\",\"\"\"\"\",.\".,,.\"\"\"\" !'\"*,!\",\".\".\"\"?,\",:\",...,,?!\".\",.!,.\",.,,,..\",'--,\n", ",,.,,,.\"\"\"\"..?-,.,.,,,\"\"\"\"-.,.,.,.;-.-.....-.,-.,, \".,.\",\",,,,\".,,,,----,...\".,,,,:\",\",,\";,,\",.\",\".\".\n", ",,.,,,.;,.-\"\"\".\".-,,.-,.\"\"\"\".,.,,.\".:\"-,\",.\"'\",.\", .\"\",\",,\"'.\"\",\".\".\"\",\".,.\"',,'\",'.\"'.'.\"\",\".\".,\",,\"\n" ] } ], "source": [ "compare(sherlock['punctuation'], wap['punctuation'], offset=100)" ] }, { "cell_type": "code", "execution_count": 86, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "..;,,',.'...,;,,.,.,,;,,',',,',,.,;',,,,.,,,,,.;,, ,,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\",.,\"\"\",\".,.,'.,,,,,\",.\n", "-,',,;'.,;,,.',;':.!,,;,.,,',';;',';,,'.?,',',,;,, \"\";\",,..,,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\"\"\"\",\"\"\"\"\n", ",,,.,;,--,.,,;,;,.,,',,,,.,:,?,:,..,!??,.!,,;,,!'. ?'\"\"!...,,.--,,,\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,.\n", ",!'.,!'.,,,,,,,,,,,,,'!':.',:,,,,'.:,,.,,:;.,,,.', .\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".'''''''''\n", "'-,,,,,.!',,',,',,,,,-.,.,.!??.:!-!'',,.:!,,,;,,'. ''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',.\n", ",,'.!,'.,.!.,.!.,.,.,,.,:!:;.,':!,,'.,.-,',,',''., .\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.-\n", "-,,;,.,:;!,:'.,.,:,!'!;?;;,',,.,,.,,'.';:,'.,';'', ,-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\"\n", "';,',.':-;,:,.?,,.',,,-.,,;,.,,,.,,.,,.,..,..,.,,. \".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\".\n", "?,?,.:,;,.:.,,.:'.!.',';.,-.,..??.,,;.':,.,.',',!' \"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,!\n", "',,;,!',;;,.,.,.,.,'.,.,.,';,';,,':,,.'?,,,.,..,'; -!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\",\n", ",,',.',,;.,'.,,,;;'.;-;,';,-;,.,.?,.-,-,--,-,.,-., !!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\"\n", ";,,,-,,,:;,,.,.,.;.;;.'.;,-.,!?,,,,,,,,,';,:;;,,:- \"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\"\n", ",'.,:';.-.;,,';;,;,,,,.,,,,;,,-.,':;,,;;-,?,,:?,'; \",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\"\n", ".,-,:',;,,'.,,-;,,'',;;,,.,,!..!,.!.,:.,!?,;',,,., .',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\"\n", "?,,,',,.,,,?,?,,?:,',,,,,,,,,'.,,,';,,:',,':,;'',: \"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\"\n", "::,,,,::-,',,.,,,,,,,.,:.;.?,.;.:,,,',',;'-;,,,,,, .\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,.\n", ",,.,,;,.?,'.,,;,,.,..,!,.,:.,.',',,-'..,,,':,'-,;' ,,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,,\n", "'',,,-.':,-,',,--.;':.;.'.',:,,,,,,,:,,'.?,.,.?',. .'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''.\n", "'';,,.!,.,-:,:,.??,,?.;,,,:,,,,;,,.,,?,..,,;.:,;,: ',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\"\n", ",?',..,';,;;:,.:;,,.,,,,.,!.,;'.',.,:,,.?,.,.,.,-, \"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\".\n", "-,:,';',:',.,::;..,..,,.,;,,;-,-,,,,.;,...,-,;,-,; ..,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\"\n", ".,,:,,;,,:,,,;,,..;,-',!,;,.,,&.,!..,-;:,,,,,',.., ,,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\"\n", ";,:',,,.,:,.;,,,.,;,,,.!,,,'.,;;.-,,,,.:,.,,;,,;,, ,,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\"\n", ".'!,,,;!:!''!,,'.!?:,,;,,.!-,-.,.',:;.,,.,,.!?.,:. \"\"\"\"\"\"...\"-..,,,.,,,-,.,,,,.;,.,-,,.,,;,.\"\".\"\".\",,\n", "!.,.,';.?:,'.,,;;,,.'??!!??,.,,,..!,.?!.,;.?!?:.!: '\".\"'\"\"'\".\"''.,,.,'\"\"'.,\"\".-..,\",.,,.,,..,-.,,..,.\n", ".,:?',.;,,;,,;'''.??',',,,,,',?,,,,.:.!','..,;.,;, .\"\",-,,--\"\".,.,',..\",\".\".\"\"\"\"\"\"\"\",\"\"\"\"\",.\".,,.\"\"\"\"\n", ":,,,!,,,.,,!.,!!,:,.!!'?!!!??,?!?,;,!.!:'.?,;'.,-- ,,.,,,.\"\"\"\"..?-,.,.,,,\"\"\"\"-.,.,.,.;-.-.....-.,-.,,\n", ";.,,?.,,.?',.,.:.;,,;,,,,,:.,,.,:.?,.,:,!,;-,.,.,, ,,.,,,.;,.-\"\"\".\".-,,.-,.\"\"\"\".,.,,.\".:\"-,\",.\"'\",.\",\n", "';,,,',',','',',',',',,:.,:,:;',.,.,,;,,.?,!;,.,., \".,.\"\",.\"\"\"\"\"\"\",.\"\"\"\",\"\"\".\"\".\"!\"\"\"\"\"\"\"\"\"\"\"\"\"\".,.,'\n", "-,,;.;,,,.,:;,,..,?;,,-,;,.,.,,',.,:,;.-,?!;';,.,. \"\".-!!\",.,..\".,\".\".\",.\"!.:\"\"\",.\"\"\"\"\"\".\"\"\"\"-,.,,.-,\n", ",.,,,.:,.,!,.''!?,,;,,.,-,,,,,',,'.'','.,;:,.,:;'. ,,,.,\",.\".:\".--..,.,,....,,.,,.,,...,,,,-,,.\",,..,\n", "'!,.,,.!!.,!,!!',',,,,:',,,,;,,,,,,,,,,.?.,!??-,?, ,-,.\",;-.,...,.;,.,\",\",\"\"-,\",.\"??\"\"\".\"'\"\",\";\"..\"\"\"\n", "!!.:;,.,:,,.-,,-,,.?,,,-,,,;,?,''?,,:';;',,,,,,.,, \"..-\".\"\".\"\"\"\".\"'\".\",\"\"..-\",,,.,.'.,.,,..-,.,,-,.,.\n", ":,,--.,.,..,;,.:,'.;;:,;',,,:.-!!!!....?;,;,,,.--, \",\".\"\"\".\"\"\"\".,.,,\",-.\"\",,.\",,.,,,\"\"\".\",,,\"\"\"\",,,.,\n", "-,-',,;:,,.,!!!!,:'..,:,.,?-.,,,,.-,.,,?-.-,:,--., .,.,,,.,.,.,...,,.,,\".,,,,.,,.,,,.',--,,,.-.,,,.',\n", ".,-.,;.,;,,.',.';,,..,!-?.,,,,,'.-,,',;':,.,,-,,', .\",,,,,\".,,.\",-,,.\".\",,.','\"\",..,\"\",,,\"\"',,,--\"\",,\n", ",;,,,,,'';,.,,;;,,.,;,,''..''-,?,',;,','.:.;.!?.;, .\"\",\"\",\"\"..'.,,-,\"..\",\".\",,\"\",\",\".'',,,.,.\"\",\".\"..\n", ",,.,',,..'?'',,'.';,,.',,';,,,,.'??!,?.,!,!''.?'!! ,\":\"-:,,,..,.--,.,',,,',\"\"\".,.\",'\".\",.,,,.,,\"\",.\"\"\n", ",,';','?!,,?;,,.':',,.,.,?.;,'.:.';,.?,--':-','.'- .,.\"\",,.\",;\"',.',.,;\"\"\".\",',.'.,.;.,,,\"\",?..'\"\",,\"\n", ",,,,.,:-,,.:'.,;;'.,',.,.',,.,,,,'.?,!:.;;.?:,,;,. ..\".,.,'.'\"\",\"\",.,-',.,,;,.\".,,,:',.,-'''.'',''-.'\n", ",?.,-!':'?,:,,,,..,,'.,.!,,,!,,?.!,,,,',','.!,.!!: ,,'.,''',,'.,.,--,,-.',.'-'.''',,'''.',,,''\",,-,.'\n", ",.,,?,,;,,,.,,,:,,'!,',.,;;;:,,,';,,..,;:'',.',',. '.'',,',.,,,.-,-;,.''','-'''.',.,.,,,,,,.,,.,;'\",,\n", ",.,.!:.,,;,.,,;,,.?,??',,,.'?,?:.!.'.!!','?',-,,-, ,,,.,.,.\",..,,,.-,''..-,,,,-,,;,,-.,;.,,.,,;\"\"\".\"\"\n", "!?-',?,,,,,,,,,,,,.,,,;;,,;,,,.,?,':,,,..:.,,,,,,, \",.,.,.,,,.'.',''''.'.',,.,,.''.',,,',.''.'.,.''.,\n", ",,,??,,,,,,?,,,'?..,,,,;;:,,.,,,.,:',.,!:,,,!!,.,. -.'','.,.,.?'\".\".'','!.,,-.'\",.,;.'',',.'',,'.',,.\n", ":.,;,:,..,,.,!,?,!,,'...;,,:,!,,!,,.?,,!,,!,!,!?,; '.''''.''\"',.,,-;.,,.''.''''''''''',,,.,..'''','.'\n", ".,.,:'.!,,?,'.!?!?!,???.';,:,,,!,?,;.,,;,:',.!!-!! '.;'.,''''\"\".,,-,.-'''.',-,.,',,.\",,;,.,'',.,,,-,,\n", "!''?,'!,,?!?,!,!!,:,.:';,,,,'.,?,?;?.,,,:;;:.,,.!, '.\",,.,..,;.'-,,.\",.,'.,.,..,,,.,,,,,,.\",,'.,.\"\"\"\"\n" ] } ], "source": [ "compare(shakespeare['punctuation'], sherlock['punctuation'], offset=100, max_lines=50)" ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ",,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\",.,\"\"\",\".,.,'.,,,,,\",. ?,,:--?!,.--,,.--,?--?.--,'?..'.,!..,,.'.,:,-..--,\n", "\"\";\",,..,,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\"\"\"\",\"\"\"\" .?--!.?--,.'..',....--!.,',:--...,,:--'!:.,'?,.--!\n", "?'\"\"!...,,.--,,,\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,. .':?..__.,,!.._!_!....--!.'.--,.''.--,.--,,,,.'...\n", ".\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".''''''''' .....--!.,!,,.,,-.,,.,,,,,,,.....--,!..?--,..--,..\n", "''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',. .,.'.',.'.--,.'.--',..'...--,,...'.!...--,,!,...?.\n", ".\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.- .--',.....,'.--,.!,:--.-.',.--',,?.....--!.''..,,.\n", ",-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\" .'..--.'.'???''.'.:,.,!,!!,,'.'.'!'!.,,',........-\n", "\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\". -,.'.--?..'.?,..--?.--,?.'.'.,.,,:--'?:--??'..??--\n", "\"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,! ,,...--?.?.--,,_,'._'.--?.??.--,,'?..'.'.'.?,'.'..\n", "-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\", .'.''.!.'..,,:--.--?.--,..--,!..,..,,.:--,?--',.:-\n", "!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\" -.?,,..,:--',.'..:_'._.,..,.,..,,.,.':,.:...,:'.?:\n", "\"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\" ,,,..:_._,:._._...,,.'.,,,,,,.,,....,.._:._!!,!.--\n", "\",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\" !'.,.,',.--,,...'.--',,.--,',...--.'.,?,.--,.--?.?\n", ".',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\" ?.--,.--,.'..,:_,',,!,!,'!_.,,.?,?,,,.....',.:,.--\n", "\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\" ',.,,?.,.--?.--,.,'!,:--!--',,.,,.,...,.--',,...,!\n", ".\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,. !,!,,.,..,,.'?,,'...--?..--,.'.--,!..:--.--!,....,\n", ",,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,, '.,:--_._.--',.,,,,'?,,':--,..--,,.:--_,,_._,',_,_\n", ".'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''. '._,.--',,,...,:--,,'?--,.--?.,?--,,.,,.'.--!,.?!,\n", "',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\" ,:_--'.,..._..--,!--,',.,.'.--',,..--?,.,!.--,,.--\n", "\"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\". ,?.--,.,...,.,.,,.,.,.,,,.,:.--,',,.--,,..--,,'.,,\n", "..,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\" '.--,?.--,',.--,..,,:.','','..--?.--,?.,.--,.?--,,\n", ",,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\" .,?--,.--',,.--,,''.''.--,..,.,'?--,,,,.:--?,,'?.-\n", ",,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\" -,?,.,'.',.,,.--,,.,.,:--!,:--,...--',.--,,,..,.,'\n", "\"\"\"\"\"\"...\"-..,,,.,,,-,.,,,,.;,.,-,,.,,;,.\"\".\"\".\",, :_--,,._:--,.'....--,,,.--,.:--,?:--.--,.:--.....'\n", "'\".\"'\"\"'\".\"''.,,.,'\"\"'.,\"\".-..,\",.,,.,,..,-.,,..,. .--.':--,.--,,,..--?.,,:--','..:--.?--?..?.',.--,,\n", ".\"\",-,,--\"\".,.,',..\",\".\".\"\"\"\"\"\"\"\",\"\"\"\"\",.\".,,.\"\"\"\" .--,,.'.--,,.:--''..'?..,,:--..--',.,,..,'...?,...\n", ",,.,,,.\"\"\"\"..?-,.,.,,,\"\"\"\"-.,.,.,.;-.-.....-.,-.,, --',..:--,?--',,.,.,.,,:--.,,,,..:--?--,,...--,!,!\n", ",,.,,,.;,.-\"\"\".\".-,,.-,.\"\"\"\".,.,,.\".:\"-,\",.\"'\",.\", :--?--,.--,.:--,.?--,,.__.--?.--,,.'..,,:--',,?--,\n" ] } ], "source": [ "compare(sherlock['punctuation'], ulysses['punctuation'], offset=100)" ] }, { "cell_type": "code", "execution_count": 88, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ",,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\",.,\"\"\",\".,.,'.,,,,,\",. .,\",\"!.\"\"?\"\"!,!__,.\"\".,,,,..\"\",.__,.-,.\"\",.\"\",,..\"\n", "\"\";\",,..,,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\"\"\"\",\"\"\"\" \",.\"\"..,,,,.,__.\"\"-,..;;.\"\".;,-.__.\"\",\";\";.\"\".,__?\n", "?'\"\"!...,,.--,,,\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,. ..\"\",....\"\",.\"\",.\"\",,.\"\",,,.\".,,,,--.__.,,.,.;....\n", ".\",.\"\",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;,\"\".''''''''' ,;..,:\".,.\"\"__.,\",\".\"\",,\",\",..\"\"...,,.\"\",\".;\".\".,,\n", "''',''''\".\",-,.--,.',--',,,\",.\"\".\"..-''..,,.,,\"',. ,.\"',,'!..\"\",\";\".\"\",\".\",?\"\"-.\"\",,\",\".;,.\"\",,,.__.\"\n", ".\",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,..,,\",,..\"\".,.,,.- \",.,,;?\"\".'..__;,.;,,,,.\"..,\",!\"\"?\".\",,?__.,?,,.\",\n", ",-.,,.-,,,,,.,,,,.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\".\" .\",\",\"..\"\".,\".\"__;?.;,.\";.;,,.\",.!..,!,,.\"\",,,\".;,\n", "\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\"\",.,..\"\",\"\".,,.\"\";\". ,,.\",!\",.\";,,.,,;,.,,__,..\"\"!\",\";__,'.\".',..,,,,..\n", "\"\",\".\",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\"!.-!,! --,,;,-,...,,,,,.!;.'.\",\".,\",.\"..',.,;.,,.;.,..,,,\n", "-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\", ,...;,.;..,,--.--.,,,..-;,,.,.--,.,;.,,,,,.,.,,;;,\n", "!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\" ;,,..;,,,..!..,,,..,,..,.,,;,..,,.\",,\",\"...\"\".,..,\n", "\"\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\" .\"\",\".,\"!,;.\"\"__,\".,.\"!!,,..\"\"?\",,:\",__;.,.\"...;.,\n", "\",\"\"\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",-,,.-,\",.\"-'\" ,;,,.....,.,.'.;,.,,,,...;.';.\"!.,\",\",..,.;.,!__,;\n", ".',.'.,,,.,,,,.,,,,,,,..,-,--,,.',.,-,.,.\",\",,,.\"\" !.,.!,,;,,;.,,.,,,,__--\"\"__,\",\"!',.!\"\"!,.!...'--\".\n", "\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,.,-.,.\",,.,,,,,,\"\"\" ..,,,..\",\",\"__;,,.!,,!!,,-..\",,.,.\",\",\",-,;!--,!\"\"\n", ".\",'..-,.,,,.,.,.,,,,..,..-,.,,.\"...,?,,?,.,.,'.,. ,\",\",..\"\"..\"\"?..__,__.?..,,..\"\"!\"\"!,,....\"\";.\"\";__\n", ",,\"\"\".\",.,,,-.,,.\",-,,,..,.,,'','&',..'\",,-,,.'.,, .__,!--.--',--.',,?.\"\"--..,;.\",;;,,.;,,.,,,,,,.;'.\n", ".'.,',''\",.,.,.'.',''-,.\".',...,...,,,.''.''.!'''. .,,..,;,,,.;,,--.,,..,.,----,,.,.,,,,.',,.,.,.,,,,\n", "',,,,''\"-,,,,,,.,,.,.,,.,-\"\"\";\"\"\",.,.,,,,.''..,\"\"\" -,..,..;;,;;,,.,,,,.,..--,,.,..,,..,;,,,,,,,.,,;,.\n", "\"\",.\",.,,-\"\"\"\"'\"\"\"\"\"\"\"\",\"\"\"\"\"\"\"\"..\",\",...,,,.\"\"\"\". ,,,.'.,...,,,-,'.;.\"__,,\".-.\"__.'.\"\";.\"\"!,,.__--__\n", "..,.\"\"\"\"....-.\"\"\"\",\"\"\"\"--,,,.\"\"\"\"\",-.\"'-,-..,.,.\"\" ------..\"\".;?.',,__?:'!,;.'\"\"!,----,,,.\"\"____,,\".\"\n", ",,,,,\"\"\"\"\"\".,,\"-.,,,,...,,.,,.,.,,.',.,,.,-,-,-.\"\" .,?--!--__.\"\"'-,,..--.\"\",'?--?\".\"..\"\"--,;.\"\",\",\",.\n", ",,\".-..,.,\"\",\"\"..'...,,\"\",\"\"...,.?,.,..\"\"\"\"!\"\"\"\"\"\" __.\"\",.,..;,.,.\"\".,\",\".\"\",,\",\"__,.\"\",',__.\"\",\",\"__\n", "\"\"\"\"\"\"...\"-..,,,.,,,-,.,,,,.;,.,-,,.,,;,.\"\".\"\".\",, ,.,,,,.,__.\"\",\",\"__,__.\"\",\",,\",.,;,-,.,..,.\"\".,\",,\n", "'\".\"'\"\"'\".\"''.,,.,'\"\"'.,\"\".-..,\",.,,.,,..,-.,,..,. \".,.\"\",\".;\",.\";,...'.;,,__.,,,,;,,'.,____,;,,,..\",\n", ".\"\",-,,--\"\".,.,',..\",\".\".\"\"\"\"\"\"\"\",\"\"\"\"\",.\".,,.\"\"\"\" \",\";.,;.,.__--;.__.;,.\"\",.,,,.\"\",,'.\"\",,.\"\",.,,;,,\n", ",,.,,,.\"\"\"\"..?-,.,.,,,\"\"\"\"-.,.,.,.;-.-.....-.,-.,, .-.,.\"\",\",\",,,.';.,..;,..\"\".__,;--.\"\";-;,.\"\",\",\";-\n", ",,.,,,.;,.-\"\"\".\".-,,.-,.\"\"\"\".,.,,.\".:\"-,\",.\"'\",.\", ,..,.;.\"\",;.,.\".',..;;,.,..,;,.;,.,,..',.\".,\",\"?\"\"\n" ] } ], "source": [ "compare(sherlock['punctuation'], pap['punctuation'], offset=100)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Compare more than two texts at a time" ] }, { "cell_type": "code", "execution_count": 89, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def compare_many(*texts, offset=0, line_len=100, gap=' ', max_lines=30):\n", " def padded_segment(text, start, length):\n", " segment = text[start:start+segment_len]\n", " segment += (' ' * (segment_len - len(segment)))\n", " return segment\n", " segment_len = line_len // len(texts) - len(gap)\n", " max_len = min(max(len(text) for text in texts), segment_len * max_lines)\n", " for i in range(offset, max_len, segment_len):\n", " segments = [padded_segment(text, i, segment_len) for text in texts]\n", " print(gap.join(segments))" ] }, { "cell_type": "code", "execution_count": 90, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "..-.......'.........,,,.,,,.,.-' ,.,-..:::,[#]:,:,]::******,,.,,. ,.,-..::::,[#]:,:******,/:::::-:\n", "..,-,.,,...,-,,,,,,,,.,,,,.:,,., \".,\",\"?\"..\",\";\".,.\"..\"?\".\"__,.\". -:-:-:::::::-:-:\",,.,',----,','!\n", ",,.-,-(,.-,,,,.,,,,.,,.,,..-...; \",,,.;,,.;,.\"\"?\"\".\"\"?\"\"!,,!;.!\"\" ?--.\",,-,.,,..,,;.,.,,-,:\",(),,-\n", ",,.,,,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\" ??\"\".,\",\"!.\"\"?\"\"!,!__,.\"\".,,,,.. -.\"\"!!\",.,,,,.,,.,,,,,.\",,.',\",.\n", ",.,\"\"\",\".,.,'.,,,,,\",.\"\";\",,..,, \"\",.__,.-,.\"\",.\"\",,..\"\",.\"\"..,,, \"??\".\",?\"\"'?.,\".\".\"\"'..\"\",,\",,-,\n", ",-.,,,-,,,\".\"\",\",.\"\"\",,.\",..,\"\"\" ,.,__.\"\"-,..;;.\"\".;,-.__.\"\",\";\"; .\"'!,'?.\"\"?\",.\"?,.\",.,,.,,.,,,,,\n", "\"\"\",\"\"\"\"?'\"\"!...,,.--,,,\",--.\"\". .\"\".,__?..\"\",....\"\",.\"\",.\"\",,.\"\" ,,,.:\",'.',,,.!..!,.,!....,,?...\n", "\"\",.\"-,'\",\"...,\"\"\".\"\"\"..,..\",.\"\" ,,,.\".,,,,--.__.,,.,.;....,;..,: '..,,.?.-,.?!!,....',...!\",.\",\",\n", ",'.\".\"\"-\".\".\",\"\"\"\"\"\"\"\"\"\".\"\".\",;, \".,.\"\"__.,\",\".\"\",,\",\",..\"\"...,,. \"'..?\"\".,\",,\",,,.,..?.?\"\",\".\",\",\n", "\"\".'''''''''''',''''\".\",-,.--,.' \"\",\".;\".\".,,,.\"',,'!..\"\",\";\".\"\", ,\"?.\",..\",\",.,',.',..,,(),:\".?.\"\n", ",--',,,\",.\"\".\"..-''..,,.,,\"',..\" \".\",?\"\"-.\"\",,\",\".;,.\"\",,,.__.\"\", .\",\",--\".?',.',\".\".,'.\".\"',\".\".\"\n", ",\".\"\",.\"..',,\"\",\"\",....\"\"-\"\".,.. .,,;?\"\".'..__;,.;,,,,.\"..,\",!\"\"? \"';.?\"(),\"'....\",,..\"?\".\",.,..\",\n", ",,\",,..\"\".,.,,.-,-.,,.-,,,,,.,,, \".\",,?__.,?,,.\",.\",\",\"..\"\".,\".\"_ .\"?,\",.\"...'!\",..\"?\".\",',.,.\",,,\n", ",.\"\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\" _;?.;,.\";.;,,.\",.!..,!,,.\"\",,,\". .\",\",,\"?,\",\",?\":\"'....?\"\"..-,'.'\n", ".\"\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",.,,\"\" ;,,,.\",!\",.\";,,.,,;,.,,__,..\"\"!\" ,..;,.--'.\"\",,\",'.\"-,.'.\",',,,.\"\n", "\",.,..\"\",\"\".,,.\"\";\".\"\",\".\",-,\"\"\" ,\";__,'.\".',..,,,,..--,,;,-,..., ,\",,\"',',,.''.\"'.:.',,';.,,*.,,.\n", ",,\"..\"\",\",.\":,,-,.\"\",\".,.--.\"\".\" ,,,,.!;.'.\",\".,\",.\"..',.,;.,,.;. ',,,..*.,\",\"\"?\",,;,'.,,;.,,,\",,.\n", "!.-!,!-!-!-!,,,,\"\".-\"\"\"\"\"\"\"\"\"\"., ,..,,,,...;,.;..,,--.--.,,,..-;, \",,.-.,,,,.,-----.,,,.,,,,.,,.,,\n", "\"\"\"\",!\"\"-\"\"\"\"\"\"\"\"\"\"\"\"\"\",!!\"\"-\"\"\" ,.,.--,.,;.,,,,,.,.,,;;,;,,..;,, ,,,.\",\",.\",,,\",.\",.\"-,-,,.\",,,\".\n", "\"..\"\"\"\"\"\".\"\"\"\",\"\"....\"\"\"\"\".\"\".\"\" ,..!..,,,..,,..,.,,;,..,,.\",,\",\" \",\",,\"?.?\",,,.\"!\".,-,,-,,.,-'.,,\n", ".\",.\"\"\"\"\"\"\"\"\"\"-,...\"\"\"\"...,.,.,- ...\"\".,..,.\"\",\".,\"!,;.\"\"__,\".,.\" ..-,,,.,,,.\",,,\",.,.,.','.:\"?.\"\"\n", "\"\"\"\"\"\"\"\".\"\",\".\",.,,\"\".\"\"\"\".\"\",\"\" !!,,..\"\"?\",,:\",__;.,.\"...;.,,;,, ,,.\"\"?\"..,.,,'.\",\".,,.,,,,,,-,,,\n", "\"\"\"\"\"\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\" .....,.,.'.;,.,,,,...;.';.\"!.,\", ..,.,'.,,,.-..,.'..,,,.,,.,,,',,\n", ",-,,.-,\",.\"-'\".',.'.,,,.,,,,.,,, \",..,.;.,!__,;!.,.!,,;,,;.,,.,,, ,..-,..',,,.'.','.\",!,,\",:\",.\".,\n", ",,,,..,-,--,,.',.,-,.,.\",\",,,.\"\" ,__--\"\"__,\",\"!',.!\"\"!,.!...'--\". .\",\".\",\".\",\";,-..\",,,\",..--.,,,,\n", "\"'.,\"\"'.,,\"\";.,.'..,..,,,..-,,,. ..,,,..\",\",\"__;,,.!,,!!,,-..\",,. ,,,,----.,.,,.\"!\";.\",,\",...,,,,.\n", ",-.,.\",,.,,,,,,\"\"\".\",'..-,.,,,., ,.\",\",\",-,;!--,!\"\",\",\",..\"\"..\"\"? ,,',..\",'....,?\",.\".\",,.\",\",,.,,\n", ".,.,,,,..,..-,.,,.\"...,?,,?,.,., ..__,__.?..,,..\"\"!\"\"!,,....\"\";.\" .,.',,-,,,,-,.,,,,.\"'?\",,.\",,\",.\n", "'.,.,,\"\"\".\",.,,,-.,,.\",-,,,..,., \";__.__,!--.--',--.',,?.\"\"--..,; \",\".-.-,,,,..,,';,',,'.,.,;.\"!\".\n", ",'','&',..'\",,-,,.'.,,.'.,',''\", .\",;;,,.;,,.,,,,,,.;'..,,..,;,,, \"!\",.,,,,.,,'-,.,.\"...,\".\"----,!\n" ] } ], "source": [ "compare_many(sherlock['punctuation'], pap['punctuation'], wap['punctuation'])" ] }, { "cell_type": "code", "execution_count": 91, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ",,,..\"\".\",,\"\"\".\",.,,.,.\"\",\"\", <> .,\",\"!.\"\"?\"\"!,!__,.\"\".,,,,..\" <> !!\",.,,,,.,,.,,,,,.\",,.',\",.\"\n", ".,\"\"\",\".,.,'.,,,,,\",.\"\";\",,.. <> \",.__,.-,.\"\",.\"\",,..\"\",.\"\".., <> ??\".\",?\"\"'?.,\".\".\"\"'..\"\",,\",,\n", ",,,-.,,,-,,,\".\"\",\",.\"\"\",,.\",. <> ,,,.,__.\"\"-,..;;.\"\".;,-.__.\"\" <> -,.\"'!,'?.\"\"?\",.\"?,.\",.,,.,,.\n", ".,\"\"\"\"\"\",\"\"\"\"?'\"\"!...,,.--,,, <> ,\";\";.\"\".,__?..\"\",....\"\",.\"\", <> ,,,,,,,,.:\",'.',,,.!..!,.,!..\n", "\",--.\"\".\"\",.\"-,'\",\"...,\"\"\".\"\" <> .\"\",,.\"\",,,.\".,,,,--.__.,,.,. <> ..,,?...'..,,.?.-,.?!!,....',\n", "\"..,..\",.\"\",'.\".\"\"-\".\".\",\"\"\"\" <> ;....,;..,:\".,.\"\"__.,\",\".\"\",, <> ...!\",.\",\",\"'..?\"\".,\",,\",,,.,\n", "\"\"\"\"\"\".\"\".\",;,\"\".'''''''''''' <> \",\",..\"\"...,,.\"\",\".;\".\".,,,.\" <> ..?.?\"\",\".\",\",,\"?.\",..\",\",.,'\n", ",''''\".\",-,.--,.',--',,,\",.\"\" <> ',,'!..\"\",\";\".\"\",\".\",?\"\"-.\"\", <> ,.',..,,(),:\".?.\".\",\",--\".?',\n", ".\"..-''..,,.,,\"',..\",\".\"\",.\". <> ,\",\".;,.\"\",,,.__.\"\",.,,;?\"\".' <> .',\".\".,'.\".\"',\".\".\"\"';.?\"(),\n", ".',,\"\",\"\",....\"\"-\"\".,..,,\",,. <> ..__;,.;,,,,.\"..,\",!\"\"?\".\",,? <> \"'....\",,..\"?\".\",.,..\",.\"?,\",\n", ".\"\".,.,,.-,-.,,.-,,,,,.,,,,.\" <> __.,?,,.\",.\",\",\"..\"\".,\".\"__;? <> .\"...'!\",..\"?\".\",',.,.\",,,.\",\n", "\".\"\",.\"\".\",.,.\"\",.,,,.,\",.\",\" <> .;,.\";.;,,.\",.!..,!,,.\"\",,,\". <> \",,\"?,\",\",?\":\"'....?\"\"..-,'.'\n", ".\"\".\"\",\";.\"\"\".\"\"\"\".\",\"\"\".\",., <> ;,,,.\",!\",.\";,,.,,;,.,,__,..\" <> ,..;,.--'.\"\",,\",'.\"-,.'.\",',,\n", ",\"\"\",.,..\"\",\"\".,,.\"\";\".\"\",\".\" <> \"!\",\";__,'.\".',..,,,,..--,,;, <> ,.\",\",,\"',',,.''.\"'.:.',,';.,\n", ",-,\"\"\",,\"..\"\",\",.\":,,-,.\"\",\". <> -,...,,,,,.!;.'.\",\".,\",.\"..', <> ,*.,,.',,,..*.,\",\"\"?\",,;,'.,,\n", ",.--.\"\".\"!.-!,!-!-!-!,,,,\"\".- <> .,;.,,.;.,..,,,,...;,.;..,,-- <> ;.,,,\",,.\",,.-.,,,,.,-----.,,\n", "\"\"\"\"\"\"\"\"\"\".,\"\"\"\",!\"\"-\"\"\"\"\"\"\"\" <> .--.,,,..-;,,.,.--,.,;.,,,,,. <> ,.,,,,.,,.,,,,,.\",\",.\",,,\",.\"\n", "\"\"\"\"\"\",!!\"\"-\"\"\"\"..\"\"\"\"\"\".\"\"\"\" <> ,.,,;;,;,,..;,,,..!..,,,..,,. <> ,.\"-,-,,.\",,,\".\",\",,\"?.?\",,,.\n", ",\"\"....\"\"\"\"\".\"\".\"\".\",.\"\"\"\"\"\"\" <> .,.,,;,..,,.\",,\",\"...\"\".,..,. <> \"!\".,-,,-,,.,-'.,,..-,,,.,,,.\n", "\"\"\"-,...\"\"\"\"...,.,.,-\"\"\"\"\"\"\"\" <> \"\",\".,\"!,;.\"\"__,\".,.\"!!,,..\"\" <> \",,,\",.,.,.','.:\"?.\"\",,.\"\"?\".\n", ".\"\",\".\",.,,\"\".\"\"\"\".\"\",\"\"\"\"\"\"\" <> ?\",,:\",__;.,.\"...;.,,;,,..... <> .,.,,'.\",\".,,.,,,,,,-,,,..,.,\n", "\"\".\"\".-.\"'\".\",,.'\".\"\".\"\"\"\"\",- <> ,.,.'.;,.,,,,...;.';.\"!.,\",\", <> '.,,,.-..,.'..,,,.,,.,,,',,,.\n", ",,.-,\",.\"-'\".',.'.,,,.,,,,.,, <> ..,.;.,!__,;!.,.!,,;,,;.,,.,, <> .-,..',,,.'.','.\",!,,\",:\",.\".\n", ",,,,,..,-,--,,.',.,-,.,.\",\",, <> ,,__--\"\"__,\",\"!',.!\"\"!,.!...' <> ,.\",\".\",\".\",\";,-..\",,,\",..--.\n", ",.\"\"\"'.,\"\"'.,,\"\";.,.'..,..,,, <> --\"...,,,..\",\",\"__;,,.!,,!!,, <> ,,,,,,,,----.,.,,.\"!\";.\",,\",.\n", "..-,,,.,-.,.\",,.,,,,,,\"\"\".\",' <> -..\",,.,.\",\",\",-,;!--,!\"\",\",\" <> ..,,,,.,,',..\",'....,?\",.\".\",\n", "..-,.,,,.,.,.,,,,..,..-,.,,.\" <> ,..\"\"..\"\"?..__,__.?..,,..\"\"!\" <> ,.\",\",,.,,.,.',,-,,,,-,.,,,,.\n" ] } ], "source": [ "compare_many(sherlock['punctuation'], pap['punctuation'], wap['punctuation'], gap=' <> ', offset=100)" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Making images\n", "The text versions are fine, but let's turn the punctuation into images, with a coloured square for each punctuation character." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start with just trying to get something out" ] }, { "cell_type": "code", "execution_count": 102, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Periods and question marks and exclamation marks are red. \n", "# Commas and quotation marks are green. \n", "# Semicolons and colons are blue. \n", "colours = {'.': (255, 0, 0), '?': (255, 0, 0), '!': (255, 0, 0),\n", " ',': (0, 255, 0), '\"': (0, 255, 0), \"'\": (0, 255, 0),\n", " ':': (0, 0, 255), ';': (0, 0, 255),\n", " 'unknown': (128, 128, 128)}\n", "max_x = 1000\n", "max_y = 400\n", "block_size = 4\n", "text = sherlock['punctuation']\n", "img = Image.new('RGBA', (max_x, max_y))\n", "draw = ImageDraw.Draw(img)\n", "x = 0\n", "y = 0\n", "i = 0\n", "# for i in range(100):\n", "# if text[i] in colours:\n", "# this_colour = colours[text[i]]\n", "for p in text:\n", " if p in colours:\n", " this_colour = colours[p]\n", " else:\n", " this_colour = colours['unknown']\n", " draw.rectangle((x, y, x+block_size, y+block_size), fill=this_colour)\n", " x += block_size\n", " if x >= max_x:\n", " x = 0\n", " y += block_size\n", "img.save('test.png')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The image: \n", "![alt text](test.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Rearrange the colours to match the \"heatmaps\" in [the original](https://medium.com/@neuroecology/punctuation-in-novels-8f316d542ec4#.qwj8e1n8m), and wrap the whole thing in a function." ] }, { "cell_type": "code", "execution_count": 93, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Periods and question marks and exclamation marks are red. \n", "# Commas and quotation marks are -green- blue. \n", "# Semicolons and colons are -blue- green. \n", "def make_image(text, block_size=4, width=1000, colours=None):\n", " default_colours = {'.': (255, 0, 0), '?': (255, 0, 0), '!': (255, 0, 0),\n", " ',': (0, 0, 255), '\"': (0, 0, 255), \"'\": (0, 0, 255),\n", " ':': (0, 255, 0), ';': (0, 255, 0),\n", " 'unknown': (128, 128, 128)}\n", " if not colours:\n", " colours = {}\n", " use_colours = default_colours.copy()\n", " use_colours.update(colours)\n", " height = ceil((len(text) * block_size) / width)\n", " img = Image.new('RGBA', (width, height))\n", " draw = ImageDraw.Draw(img)\n", " x = 0\n", " y = 0\n", " for p in text:\n", " if p in use_colours:\n", " this_colour = use_colours[p]\n", " else:\n", " this_colour = use_colours['unknown']\n", " draw.rectangle((x, y, x+block_size, y+block_size), fill=this_colour)\n", " x += block_size\n", " if x >= width:\n", " x = 0\n", " y += block_size\n", " return img" ] }, { "cell_type": "code", "execution_count": 94, "metadata": { "collapsed": false }, "outputs": [], "source": [ "i = make_image(sherlock['punctuation'])\n", "i.save('sherlock.png')" ] }, { "cell_type": "code", "execution_count": 95, "metadata": { "collapsed": true }, "outputs": [], "source": [ "i = make_image(wap['punctuation'], block_size=6, colours={'-': (255,255,255)})\n", "i.save('wap.png')" ] }, { "cell_type": "code", "execution_count": 96, "metadata": { "collapsed": false }, "outputs": [], "source": [ "i = make_image(wap['punctuation'], colours={'-': (255,255,255), '(': (255, 165, 0), ')': (255, 165, 0)})\n", "i.save('wap.png')" ] }, { "cell_type": "code", "execution_count": 97, "metadata": { "collapsed": true }, "outputs": [], "source": [ "i = make_image(shakespeare['punctuation'])\n", "i.save('shakespeare.png')" ] }, { "cell_type": "code", "execution_count": 98, "metadata": { "collapsed": true }, "outputs": [], "source": [ "i = make_image(ulysses['punctuation'], colours={'-': (255,255,255), '(': (255, 165, 0), ')': (255, 165, 0)})\n", "i.save('ulysses.png')" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "collapsed": true }, "outputs": [], "source": [ "i = make_image(pap['punctuation'])\n", "i.save('pap.png')" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "Sherlock: \n", "![alt text](sherlock.png)\n", "\n", "War and Peace:\n", "![alt text](wap.png)\n", "\n", "Shakespeare:\n", "![alt text](shakespeare.png)\n", "\n", "Ulysses:\n", "![alt text](ulysses.png)\n", "\n", "Pride and Prejudice:\n", "![alt text](pap.png)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3+" } }, "nbformat": 4, "nbformat_minor": 0 }