{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Collating for real with Collatex (2)\n", "Here we can repeat the same steps done in the previous exercise, with a new and slightly more complicated text case. You can create a new notebook for this exercise and follow the instructions below.\n", "\n", "We will be using different editions of Virginia Woolf's \"To the lighthouse\":\n", "- USA = New York: Harcourt, Brace & Company, 1927 (1st USA edition)\n", "- UK = Londond: R & R Clark Limited, 1827 (1st UK edition)\n", "- EM (EVERYMAN) = London: J. M. Dent & Sons LTD, 1938 (reprint 1952)\n", "\n", "The facsimiles and trascriptions of the editions are available at http://woolfonline.com/ " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### First exercise\n", "Try to reproduce what you have done with the Darwin text." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the *collatex* Python library" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from collatex import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a collation object" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "collation = Collation()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now open the texts in \"../fixtures/Woolf/Lighthouse-1\" and let Python read them" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "witness_USA = open( \"../fixtures/Woolf/Lighthouse-1/Lighthouse-1-USA.txt\", encoding='utf-8' ).read()\n", "witness_UK = open( \"../fixtures/Woolf/Lighthouse-1/Lighthouse-1-UK.txt\", encoding='utf-8' ).read()\n", "witness_EM = open( \"../fixtures/Woolf/Lighthouse-1/Lighthouse-1-EM.txt\", encoding='utf-8' ).read()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Add them to the CollateX instance as witnesses" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "collation.add_plain_witness( \"USA\", witness_USA )\n", "collation.add_plain_witness( \"UK\", witness_UK )\n", "collation.add_plain_witness( \"EM\", witness_EM )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Align, using the HTML output option" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
USA | \n", "UK | \n", "EM | \n", "
---|---|---|
When she looked in the glass and saw her hair grey, her cheek sunk, at fifty, she thought, possibly she might have managed things better—her husband; money; his books. But for her own part she would never for a single second regret her decision, evade difficulties, or slur over duties. She was now formidable to behold, and it was only in silence, looking up from their plates, after she had spoken so severely about Charles Tansley, that her daughters | \n",
" When she looked in the glass and saw her hair grey, her cheek sunk, at fifty, she thought, possibly she might have managed things better—her husband; money; his books. But for her own part she would never for a single second regret her decision, evade difficulties, or slur over duties. She was now formidable to behold, and it was only in silence, looking up from their plates, after she had spoken so severely about Charles Tansley, that her daughters | \n",
" When she looked in the glass and saw her hair grey, her cheek sunk, at fifty, she thought, possibly she might have managed things better—her husband; money; his books. But for her own part she would never for a single second regret her decision, evade difficulties, or slur over duties. She was now formidable to behold, and it was only in silence, looking up from their plates, after she had spoken so severely about Charles Tansley, that her daughters | \n",
"
, | \n", "— | \n", "— | \n", "
Prue, Nancy, Rose—could sport with infidel ideas which they had brewed for themselves of a life different from hers; in Paris, perhaps; a wilder life; not always taking care of some man or other; for there was in all their minds a mute questioning of deference and chivalry, of the Bank of England and the Indian Empire, of ringed fingers and lace, though to them all there was something in this of the essence of beauty, which called out the manliness in their girlish hearts, and made them, as they sat at table beneath their mother’s eyes, honour her strange severity, her extreme courtesy, like a | \n",
" Prue, Nancy, Rose—could sport with infidel ideas which they had brewed for themselves of a life different from hers; in Paris, perhaps; a wilder life; not always taking care of some man or other; for there was in all their minds a mute questioning of deference and chivalry, of the Bank of England and the Indian Empire, of ringed fingers and lace, though to them all there was something in this of the essence of beauty, which called out the manliness in their girlish hearts, and made them, as they sat at table beneath their mother’s eyes, honour her strange severity, her extreme courtesy, like a | \n",
" Prue, Nancy, Rose—could sport with infidel ideas which they had brewed for themselves of a life different from hers; in Paris, perhaps; a wilder life; not always taking care of some man or other; for there was in all their minds a mute questioning of deference and chivalry, of the Bank of England and the Indian Empire, of ringed fingers and lace, though to them all there was something in this of the essence of beauty, which called out the manliness in their girlish hearts, and made them, as they sat at table beneath their mother’s eyes, honour her strange severity, her extreme courtesy, like a | \n",
"
Queen | \n", "Queen | \n", "queen | \n", "
’s raising from the mud | \n",
" ’s raising from the mud | \n",
" ’s raising from the mud | \n",
"
to wash | \n", "- | \n", "- | \n", "
a beggar | \n", "a beggar | \n", "a beggar | \n", "
’ | \n", "’ | \n", "' | \n", "
s dirty foot | \n", "s dirty foot | \n", "s dirty foot | \n", "
- | \n", "and washing | \n", "and washing | \n", "
- | \n", "- | \n", "it | \n", "
, when she thus admonished them so very severely about that wretched atheist who had chased them | \n",
" , when she thus admonished them so very severely about that wretched atheist who had chased them | \n",
" , when she thus admonished them so very severely about that wretched atheist who had chased them | \n",
"
- | \n", "- | \n", "to | \n", "
—or, speaking accurately, been invited to stay with them | \n",
" —or, speaking accurately, been invited to stay with them | \n",
" —or, speaking accurately, been invited to stay with them | \n",
"
- | \n", "- | \n", "in | \n", "
— | \n", "— | \n", "— | \n", "
in the | \n", "in the | \n", "the | \n", "
Isles | \n", "Isle | \n", "Isle | \n", "
of Skye. | \n", "of Skye. | \n", "of Skye. | \n", "
USA | \n", "UK | \n", "EM | \n", "
---|---|---|
No, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The other | \n", "No, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The other | \n", "No, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The other | \n", "
Lighthouse | \n", "- | \n", "- | \n", "
was | \n", "was | \n", "was | \n", "
true | \n", "the Lighthouse | \n", "the Lighthouse | \n", "
too. It was\n", "sometimes hardly to\n", "be seen across the\n", "bay. In the evening\n", "one looked up and\n", "saw the eye opening\n", "and shutting and the\n", "light seemed to\n", "reach them in that\n", "airy sunny garden\n", "where they sat. But\n", "he pulled himself\n", "up. Whenever he said | \n", "too. It was\n", "sometimes hardly to\n", "be seen across the\n", "bay. In the evening\n", "one looked up and\n", "saw the eye opening\n", "and shutting and the\n", "light seemed to\n", "reach them in that\n", "airy sunny garden\n", "where they sat. But\n", "he pulled himself\n", "up. Whenever he said | \n", "too. It was\n", "sometimes hardly to\n", "be seen across the\n", "bay. In the evening\n", "one looked up and\n", "saw the eye opening\n", "and shutting and the\n", "light seemed to\n", "reach them in that\n", "airy sunny garden\n", "where they sat. But\n", "he pulled himself\n", "up. Whenever he said | \n", "
\" | \n", "\" | \n", "' | \n", "
they | \n", "they | \n", "they | \n", "
\" | \n", "\" | \n", "’ | \n", "
or | \n", "or | \n", "or | \n", "
\" | \n", "\" | \n", "‘ | \n", "
a person | \n", "a person | \n", "a person | \n", "
,\" | \n", "\", | \n", ",' | \n", "
and then began\n", "hearing the rustle\n", "of | \n", "and then began\n", "hearing the rustle\n", "of | \n", "and then began\n", "hearing the rustle\n", "of | \n", "
some one | \n", "some one | \n", "someone | \n", "
coming, the tinkle\n", "of someone going, he\n", "became extremely\n", "sensitive to the\n", "presence of whoever\n", "might be in the\n", "room. It was his\n", "father now. The\n", "strain | \n", "coming, the tinkle\n", "of someone going, he\n", "became extremely\n", "sensitive to the\n", "presence of whoever\n", "might be in the\n", "room. It was his\n", "father now. The\n", "strain | \n", "coming, the tinkle\n", "of someone going, he\n", "became extremely\n", "sensitive to the\n", "presence of whoever\n", "might be in the\n", "room. It was his\n", "father now. The\n", "strain | \n", "
was | \n", "became | \n", "became | \n", "
acute. For in one\n", "moment if there was\n", "no breeze, his\n", "father would slap\n", "the covers of his\n", "book together, and\n", "say | \n", "acute. For in one\n", "moment if there was\n", "no breeze, his\n", "father would slap\n", "the covers of his\n", "book together, and\n", "say | \n", "acute. For in one\n", "moment if there was\n", "no breeze, his\n", "father would slap\n", "the covers of his\n", "book together, and\n", "say | \n", "
: \" | \n", ": \" | \n", ": ‘ | \n", "
What’ | \n", "What' | \n", "What’ | \n", "
s happening now?\n", "What are we dawdling\n", "about here for, eh | \n", "s happening now?\n", "What are we dawdling\n", "about here for, eh | \n", "s happening now?\n", "What are we dawdling\n", "about here for, eh | \n", "
?\" | \n", "?\" | \n", "?’ | \n", "
as, once before | \n", "as, once before | \n", "as, once before | \n", "
- | \n", "- | \n", ", | \n", "
he had brought his\n", "blade down among\n", "them on the terrace\n", "and she had gone\n", "stiff all over, and\n", "if there had been an\n", "axe handy, a knife,\n", "or anything with a\n", "sharp point he would\n", "have seized it and\n", "struck his father\n", "through the heart. | \n", "he had brought his\n", "blade down among\n", "them on the terrace\n", "and she had gone\n", "stiff all over, and\n", "if there had been an\n", "axe handy, a knife,\n", "or anything with a\n", "sharp point he would\n", "have seized it and\n", "struck his father\n", "through the heart. | \n", "he had brought his\n", "blade down among\n", "them on the terrace\n", "and she had gone\n", "stiff all over, and\n", "if there had been an\n", "axe handy, a knife,\n", "or anything with a\n", "sharp point he would\n", "have seized it and\n", "struck his father\n", "through the heart. | \n", "
She | \n", "His mother | \n", "His mother | \n", "
had gone stiff all\n", "over, and then, her\n", "arm slackening, so\n", "that he felt she\n", "listened to him no\n", "longer, she had\n", "risen somehow and\n", "gone away and left\n", "him there, impotent,\n", "ridiculous, sitting\n", "on the floor\n", "grasping a pair of\n", "scissors. Not a\n", "breath of wind blew.\n", "The water chuckled\n", "and gurgled in the\n", "bottom of the boat\n", "where three or four\n", "mackerel beat their\n", "tails up and down in\n", "a pool of water not\n", "deep enough to cover\n", "them. At any moment\n", "Mr | \n", "had gone stiff all\n", "over, and then, her\n", "arm slackening, so\n", "that he felt she\n", "listened to him no\n", "longer, she had\n", "risen somehow and\n", "gone away and left\n", "him there, impotent,\n", "ridiculous, sitting\n", "on the floor\n", "grasping a pair of\n", "scissors. Not a\n", "breath of wind blew.\n", "The water chuckled\n", "and gurgled in the\n", "bottom of the boat\n", "where three or four\n", "mackerel beat their\n", "tails up and down in\n", "a pool of water not\n", "deep enough to cover\n", "them. At any moment\n", "Mr | \n", "had gone stiff all\n", "over, and then, her\n", "arm slackening, so\n", "that he felt she\n", "listened to him no\n", "longer, she had\n", "risen somehow and\n", "gone away and left\n", "him there, impotent,\n", "ridiculous, sitting\n", "on the floor\n", "grasping a pair of\n", "scissors. Not a\n", "breath of wind blew.\n", "The water chuckled\n", "and gurgled in the\n", "bottom of the boat\n", "where three or four\n", "mackerel beat their\n", "tails up and down in\n", "a pool of water not\n", "deep enough to cover\n", "them. At any moment\n", "Mr | \n", "
. | \n", ". | \n", "- | \n", "
Ramsay ( | \n", "Ramsay ( | \n", "Ramsay ( | \n", "
he | \n", "James | \n", "James | \n", "
scarcely dared look\n", "at him) might rouse\n", "himself, shut his\n", "book, and say\n", "something sharp; but\n", "for the moment he\n", "was reading, so that\n", "James stealthily, as\n", "if he were stealing\n", "downstairs on bare\n", "feet, afraid of\n", "waking a watchdog by\n", "a creaking board,\n", "went on thinking\n", "what was she like,\n", "where did she go\n", "that day? He began\n", "following her from\n", "room to room and at\n", "last they came to a\n", "room where in a blue\n", "light, as if the\n", "reflection came from\n", "many china dishes,\n", "she talked to\n", "somebody; he\n", "listened to her\n", "talking. She talked\n", "to a servant, saying\n", "simply whatever came\n", "into her head | \n", "scarcely dared look\n", "at him) might rouse\n", "himself, shut his\n", "book, and say\n", "something sharp; but\n", "for the moment he\n", "was reading, so that\n", "James stealthily, as\n", "if he were stealing\n", "downstairs on bare\n", "feet, afraid of\n", "waking a watchdog by\n", "a creaking board,\n", "went on thinking\n", "what was she like,\n", "where did she go\n", "that day? He began\n", "following her from\n", "room to room and at\n", "last they came to a\n", "room where in a blue\n", "light, as if the\n", "reflection came from\n", "many china dishes,\n", "she talked to\n", "somebody; he\n", "listened to her\n", "talking. She talked\n", "to a servant, saying\n", "simply whatever came\n", "into her head | \n", "scarcely dared look\n", "at him) might rouse\n", "himself, shut his\n", "book, and say\n", "something sharp; but\n", "for the moment he\n", "was reading, so that\n", "James stealthily, as\n", "if he were stealing\n", "downstairs on bare\n", "feet, afraid of\n", "waking a watchdog by\n", "a creaking board,\n", "went on thinking\n", "what was she like,\n", "where did she go\n", "that day? He began\n", "following her from\n", "room to room and at\n", "last they came to a\n", "room where in a blue\n", "light, as if the\n", "reflection came from\n", "many china dishes,\n", "she talked to\n", "somebody; he\n", "listened to her\n", "talking. She talked\n", "to a servant, saying\n", "simply whatever came\n", "into her head | \n", "
. | \n", ". \" | \n", ". ' | \n", "
- | \n", "We shall need a big\n", "dish to-night. Where\n", "is it—the blue dish | \n", "We shall need a big\n", "dish to-night. Where\n", "is it— the blue dish | \n", "
- | \n", "?\" | \n", "?’ | \n", "
She alone spoke the\n", "truth; to her alone\n", "could he speak it. | \n", "She alone spoke the\n", "truth; to her alone\n", "could he speak it. | \n", "She alone spoke the\n", "truth; to her alone\n", "could he speak it. | \n", "