{ "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": [ "\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", "
USAUKEM
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
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
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
,
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
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
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
QueenQueenqueen
’s raising from the
mud
’s raising from the
mud
’s raising from the
mud
to wash--
a beggara beggara beggar
'
s dirty foots dirty foots dirty foot
-and washingand washing
--it
, when she thus
admonished them so
very severely about
that wretched
atheist who had
chased them
, when she thus
admonished them so
very severely about
that wretched
atheist who had
chased them
, when she thus
admonished them so
very severely about
that wretched
atheist who had
chased them
--to
—or, speaking
accurately, been
invited to stay with
them
—or, speaking
accurately, been
invited to stay with
them
—or, speaking
accurately, been
invited to stay with
them
--in
in thein thethe
IslesIsleIsle
of Skye.of Skye.of Skye.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "alignment_table = collate(collation, layout='vertical', output='html')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you want to know more about this text:\n", "\n", "Look at the sources\n", "- USA, p. 14\n", "http://woolfonline.com/?node=content/text/transcriptions&project=1&parent=2&taxa=19&content=2817&pos=15\n", "- UK, pp. 16-17\n", "http://woolfonline.com/?node=content/text/transcriptions&project=1&parent=2&taxa=20&content=3139&pos=19\n", "- EVERYMAN, p. 7\n", "http://woolfonline.com/?node=content/text/transcriptions&project=1&parent=2&taxa=22&content=3804&pos=24\n", "\n", "Start thinking about how to handle situation like the following (proof with corrections in the margin)\n", "- http://woolfonline.com/?node=content/text/transcriptions&project=1&parent=2&taxa=18&content=4172&pos=14\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Second exercise\n", "In the second exercise, repeat the previous steps, now using the texts at \"../fixtures/Woolf/Lighthouse-2\" and visualizing the output with the more sophisticated HTML option (HTML2).\n" ] }, { "cell_type": "code", "execution_count": 6, "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", "
USAUKEM
No, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The otherNo, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The otherNo, the other was\n", "also the Lighthouse.\n", "For nothing was\n", "simply one thing.\n", "The other
Lighthouse--
waswaswas
truethe Lighthousethe Lighthouse
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 saidtoo. 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 saidtoo. 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
\"\"'
theytheythey
\"\"
ororor
\"\"
a persona persona person
,\"\",,'
and then began\n", "hearing the rustle\n", "ofand then began\n", "hearing the rustle\n", "ofand then began\n", "hearing the rustle\n", "of
some onesome onesomeone
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", "straincoming, 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", "straincoming, 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
wasbecamebecame
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", "sayacute. 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", "sayacute. 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
: \": \": ‘
What’What'What’
s happening now?\n", "What are we dawdling\n", "about here for, ehs happening now?\n", "What are we dawdling\n", "about here for, ehs happening now?\n", "What are we dawdling\n", "about here for, eh
?\"?\"?’
as, once beforeas, once beforeas, once before
--,
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.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.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.
SheHis motherHis mother
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", "Mrhad 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", "Mrhad 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
..-
Ramsay (Ramsay (Ramsay (
heJamesJames
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 headscarcely 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 headscarcely 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
.. \". '
-We shall need a big\n", "dish to-night. Where\n", "is it—the blue dishWe shall need a big\n", "dish to-night. Where\n", "is it— the blue dish
-?\"?’
She alone spoke the\n", "truth; to her alone\n", "could he speak it.She alone spoke the\n", "truth; to her alone\n", "could he speak it.She alone spoke the\n", "truth; to her alone\n", "could he speak it.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "collation = Collation()\n", "witness_USA = open( \"../fixtures/Woolf/Lighthouse-2/Lighthouse-2-USA.txt\", encoding='utf-8' ).read()\n", "witness_UK = open( \"../fixtures/Woolf/Lighthouse-2/Lighthouse-2-UK.txt\", encoding='utf-8' ).read()\n", "witness_EM = open( \"../fixtures/Woolf/Lighthouse-2/Lighthouse-2-EM.txt\", encoding='utf-8' ).read()\n", "collation.add_plain_witness( \"USA\", witness_USA )\n", "collation.add_plain_witness( \"UK\", witness_UK )\n", "collation.add_plain_witness( \"EM\", witness_EM )\n", "alignment_table = collate(collation, output='html2')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### What's next?\n", "\n", "Look at the results above and think about what you want to consider in your collation.\n", "\n", "- Do you want, for example, to consider punctuation? We will talk about how to prepare and normalize the witnesses in Unit 6.\n", "\n", "- What about if you consider a messy manuscript as one of the witnesses for the collation ... Something like this\n", "http://woolfonline.com/?node=content/text/transcriptions&project=1&parent=6&taxa=26&content=5473&pos=8&search=Not%20a%20breath%20of%20wind%20blew&exact ... Do you recognize it? Is another witness of the text used in Exercise 2. In order to register *all the texts* on this page, scholars use markup, and in particular XML-TEI. We will talk about collation of XML documents in Unit 7.\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [Root]", "language": "python", "name": "Python [Root]" }, "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.5.2" } }, "nbformat": 4, "nbformat_minor": 0 }