## Collating for real with Collatex (2)¶

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.

We will be using different editions of Virginia Woolf's "To the lighthouse":

• USA = New York: Harcourt, Brace & Company, 1927 (1st USA edition)
• UK = Londond: R & R Clark Limited, 1827 (1st UK edition)
• EM (EVERYMAN) = London: J. M. Dent & Sons LTD, 1938 (reprint 1952)

The facsimiles and trascriptions of the editions are available at http://woolfonline.com/

### First exercise¶

Try to reproduce what you have done with the Darwin text.

Import the collatex Python library

In [2]:
from collatex import *


Create a collation object

In [3]:
collation = Collation()


Now open the texts in "../fixtures/Woolf/Lighthouse-1" and let Python read them

In [4]:
witness_USA = open( "../fixtures/Woolf/Lighthouse-1/Lighthouse-1-USA.txt", encoding='utf-8' ).read()
witness_UK = open( "../fixtures/Woolf/Lighthouse-1/Lighthouse-1-UK.txt", encoding='utf-8' ).read()
witness_EM = open( "../fixtures/Woolf/Lighthouse-1/Lighthouse-1-EM.txt", encoding='utf-8' ).read()


Add them to the CollateX instance as witnesses

In [5]:
collation.add_plain_witness( "USA", witness_USA )


Align, using the HTML output option

In [6]:
alignment_table = collate(collation, layout='vertical', output='html')

USA UK EM
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,
or slur over duties.
She was now
formidable to
behold, and it was
only in silence,
looking up from
their plates, after
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,
or slur over duties.
She was now
formidable to
behold, and it was
only in silence,
looking up from
their plates, after
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,
or slur over duties.
She was now
formidable to
behold, and it was
only in silence,
looking up from
their plates, after
Charles Tansley,
that her daughters
,
Prue, Nancy,
Rose—could sport
with infidel ideas
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
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
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
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
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
them, as they sat at
table beneath their
mother’s eyes,
honour her strange
severity, her
extreme courtesy,
like a
Queen Queen queen
’s raising from the
mud
’s raising from the
mud
’s raising from the
mud
to wash - -
a beggar a beggar a beggar
'
s dirty foot s dirty foot s dirty foot
- and washing and washing
- - it
, when she thus
that wretched
chased them
, when she thus
that wretched
chased them
, when she thus
that wretched
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 the in the the
Isles Isle Isle
of Skye. of Skye. of Skye.

Look at the sources

Start thinking about how to handle situation like the following (proof with corrections in the margin)

### Second exercise¶

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).

In [6]:
collation = Collation()
witness_USA = open( "../fixtures/Woolf/Lighthouse-2/Lighthouse-2-USA.txt", encoding='utf-8' ).read()
witness_UK = open( "../fixtures/Woolf/Lighthouse-2/Lighthouse-2-UK.txt", encoding='utf-8' ).read()
witness_EM = open( "../fixtures/Woolf/Lighthouse-2/Lighthouse-2-EM.txt", encoding='utf-8' ).read()
alignment_table = collate(collation, output='html2')

USA UK EM
No, the other was also the Lighthouse. For nothing was simply one thing. The other No, the other was also the Lighthouse. For nothing was simply one thing. The other No, the other was also the Lighthouse. For nothing was simply one thing. The other
Lighthouse - -
was was was
true the Lighthouse the Lighthouse
too. It was sometimes hardly to be seen across the bay. In the evening one looked up and saw the eye opening and shutting and the light seemed to reach them in that airy sunny garden where they sat. But he pulled himself up. Whenever he said too. It was sometimes hardly to be seen across the bay. In the evening one looked up and saw the eye opening and shutting and the light seemed to reach them in that airy sunny garden where they sat. But he pulled himself up. Whenever he said too. It was sometimes hardly to be seen across the bay. In the evening one looked up and saw the eye opening and shutting and the light seemed to reach them in that airy sunny garden where they sat. But he pulled himself up. Whenever he said
" " '
they they they
" "
or or or
" "
a person a person a person
," ", ,'
and then began hearing the rustle of and then began hearing the rustle of and then began hearing the rustle of
some one some one someone
coming, the tinkle of someone going, he became extremely sensitive to the presence of whoever might be in the room. It was his father now. The strain coming, the tinkle of someone going, he became extremely sensitive to the presence of whoever might be in the room. It was his father now. The strain coming, the tinkle of someone going, he became extremely sensitive to the presence of whoever might be in the room. It was his father now. The strain
was became became
acute. For in one moment if there was no breeze, his father would slap the covers of his book together, and say acute. For in one moment if there was no breeze, his father would slap the covers of his book together, and say acute. For in one moment if there was no breeze, his father would slap the covers of his book together, and say
: " : " : ‘
What’ What' What’
s happening now? What are we dawdling about here for, eh s happening now? What are we dawdling about here for, eh s happening now? What are we dawdling about here for, eh
?" ?" ?’
as, once before as, once before as, once before
- - ,
She His mother His mother
had gone stiff all over, and then, her arm slackening, so that he felt she listened to him no longer, she had risen somehow and gone away and left him there, impotent, ridiculous, sitting on the floor grasping a pair of scissors. Not a breath of wind blew. The water chuckled and gurgled in the bottom of the boat where three or four mackerel beat their tails up and down in a pool of water not deep enough to cover them. At any moment Mr had gone stiff all over, and then, her arm slackening, so that he felt she listened to him no longer, she had risen somehow and gone away and left him there, impotent, ridiculous, sitting on the floor grasping a pair of scissors. Not a breath of wind blew. The water chuckled and gurgled in the bottom of the boat where three or four mackerel beat their tails up and down in a pool of water not deep enough to cover them. At any moment Mr had gone stiff all over, and then, her arm slackening, so that he felt she listened to him no longer, she had risen somehow and gone away and left him there, impotent, ridiculous, sitting on the floor grasping a pair of scissors. Not a breath of wind blew. The water chuckled and gurgled in the bottom of the boat where three or four mackerel beat their tails up and down in a pool of water not deep enough to cover them. At any moment Mr
. . -
Ramsay ( Ramsay ( Ramsay (
he James James
scarcely dared look at him) might rouse himself, shut his book, and say something sharp; but for the moment he was reading, so that James stealthily, as if he were stealing downstairs on bare feet, afraid of waking a watchdog by a creaking board, went on thinking what was she like, where did she go that day? He began following her from room to room and at last they came to a room where in a blue light, as if the reflection came from many china dishes, she talked to somebody; he listened to her talking. She talked to a servant, saying simply whatever came into her head scarcely dared look at him) might rouse himself, shut his book, and say something sharp; but for the moment he was reading, so that James stealthily, as if he were stealing downstairs on bare feet, afraid of waking a watchdog by a creaking board, went on thinking what was she like, where did she go that day? He began following her from room to room and at last they came to a room where in a blue light, as if the reflection came from many china dishes, she talked to somebody; he listened to her talking. She talked to a servant, saying simply whatever came into her head scarcely dared look at him) might rouse himself, shut his book, and say something sharp; but for the moment he was reading, so that James stealthily, as if he were stealing downstairs on bare feet, afraid of waking a watchdog by a creaking board, went on thinking what was she like, where did she go that day? He began following her from room to room and at last they came to a room where in a blue light, as if the reflection came from many china dishes, she talked to somebody; he listened to her talking. She talked to a servant, saying simply whatever came into her head
. . " . '
- We shall need a big dish to-night. Where is it—the blue dish We shall need a big dish to-night. Where is it— the blue dish
- ?" ?’
She alone spoke the truth; to her alone could he speak it. She alone spoke the truth; to her alone could he speak it. She alone spoke the truth; to her alone could he speak it.

### What's next?¶

Look at the results above and think about what you want to consider in your collation.

In [ ]: