Self-Test: TEI Encoding#

Note

This assessment helps you check your understanding of the chapter TEI Encoding: Preparing Texts for Programmable Corpora.

  • There is no grading and nothing is stored.

  • Read the feedback for each option carefully, even if you answered correctly.

  • If you are unsure, return to the relevant section of the chapter (or the interface/tool) and verify what you see.

Estimated time: 20–30 minutes.

Exercise 1: Encoding Strategy#

The Characteristics of the Encoding Strategies#

Assign the correct characteristics to the following encoding strategies.

Choosing an Encoding Strategy: Case 1#

You want to encode a corpus of 50 texts from a digital text collection. The format is HTML. Core elements, such as the headings, speaker names, or stage directions, are marked up regularly.

Rank the following encoding strategies from most to least time-consuming:
manual encoding in an XML editor
Drop here.
semi-automatic encoding with EzDrama
Drop here.
semi-automatic encoding with a transformation script (regular expression; R, Python, XSLT, XQuery)
Drop here.
Drag and drop the elements to the correct statements.
1
2
3
Rank the following encoding strategies from those that are the most transparent and allow the most direct control in the encoding process to those which are least transparent and allow the least direct control in the encoding process:
manual encoding in an XML editor
Drop here.
semi-automatic encoding with EzDrama
Drop here.
semi-automatic encoding with a transformation script (regular expression; R, Python, XSLT, XQuery)
Drop here.
semi-automatic encoding with a Large Language Model (LLM)
Drop here.
Drag and drop the elements to the correct statements.
1
2
3
4

Choosing an Encoding Strategy: Case 2#

You want to encode De Monfort by Joanna Baillie. Your text source has no pre-existing markup. The format is .txt.

Here is an excerpt from act 1, scene 2:[1]

SCENE II.
_(A Small Apartment in JEROME'S House: a table and breakfast set out. Enter DE MONFORT, followed by MANUEL, and sets himself down by the table, with a cheerful face.)_
DE MON. Manuel, this morning's sun shines pleasantly:
These old apartments too are light and cheerful.
Our landlord's kindness has reviv'd me much;
He serves as though he lov'd me. This pure air
Braces the listless nerves, and warms the blood;
I feel in freedom here.
_(Filling a cup of coffee, and drinking.)_

MAN. Ah! sure, my Lord,
No air is purer than the air at home.

DE MON. Here can I wander with assured steps,
Nor dread, at every winding of the path,
Lest an abhorred serpent cross my way,
And move—_(Stopping short.)_

MAN. What says your honour?
There are no serpents in our pleasant fields.

DE MON. Think'st thou there are no serpents in the world
But those who slide along the grassy sod,
And sting the luckless foot that presses them?
There are who in the path of social life
Do bask their spotted skins in Fortune's sun,
And sting the soul—Ay, till its healthful frame
Is chang'd to secret, fest'ring, sore disease,
So deadly is the wound.

MAN. Heaven guard your honour from such horrid skathe:
They are but rare, I hope?

DE MON. _(Shaking his head.)_ We mark the hollow eye, the wasted frame,
The gait disturb'd of wealthy honour'd men,
But do not know the cause.

MAN. 'Tis very true. God keep you well, my Lord!

Choosing an Encoding Strategy: Case 3#

You want to encode The Belle’s Stratagem by Hannah Cowley. Your text source has no pre-existing markup. The format is .txt.

Here is an excerpt from act 3, scene 1:[2]

ACT III.
SCENE I. Mr. Hardy's.
Enter Letitia and Mrs. Racket.
Mrs. Racket. Come, prepare, prepare; your Lover is coming.
Letit. My Lover!—Confess now that my absence at dinner was a severe mortification to him.
Mrs. Rack. I can't absolutely swear it spoilt his appetite; he eat as if he was hungry, and drank his wine as though he liked it.
Letit. What was the apology?
Mrs. Rack. That you were ill;—but I gave him a hint, that your extreme bashfulness could not support his eye.
Letit. If I comprehend him, aukwardness and bashfulness are the last faults he can pardon in a woman; so expect to see me transform'd into the veriest maukin.
Mrs. Rack. You persevere then?
Letit. Certainly. I know the design is a rash one, and the event important;—it either makes Doricourt mine by all the tenderest ties of passion, or deprives me of him for ever; and never to be his wife will afflict me less, than to be his wife and not be belov'd.
Mrs. Rack. So you wo'n't trust to the good old maxim—"Marry first, and love will follow?"
Letit. As readily as I would venture my last guinea, that good fortune might follow. The woman that has not touch'd the heart of a man before he leads her to the altar, has scarcely a chance to charm it when possession and security turn their powerful arms against her.—But here he comes.—I'll disappear for a moment.—Don't spare me.
Exit Letitia.

Exercise 2: Manual Encoding#

Manual Encoding: Case 1#

Complete the encoding by replacing each <ADD> placeholder with the correct TEI/XML element, closing tag or text in the following passage from act 1, scene 2 of De Monfort by Joanna Baillie.[1] The play is written in verse.

<div type="ADD" n="ADD">
<head>SCENE II.<ADD>
<ADD>(A Small Apartment in JEROME'S House: a table and breakfast set out. Enter DE MONFORT, followed by MANUEL, and sets himself down by the table, with a cheerful face.)<ADD>
<sp who="#de-monfort">
<speaker>DE MON.</speaker>
<l>Manuel, this morning's sun shines pleasantly:<ADD>
<l>These old apartments too are light and cheerful.</l>
<ADD>Our landlord's kindness has reviv'd me much;</l>
<l>He serves as though he lov'd me. This pure air</l>
<l>Braces the listless nerves, and warms the blood;</l>
<l>I feel in freedom here.<ADD>
<ADD>(Filling a cup of coffee, and drinking.)<ADD>
</sp>
<sp who="#manuel">
<ADD>MAN.<ADD>
<ADD>Ah! sure, my Lord,<ADD>
<ADD>No air is purer than the air at home.<ADD>
<ADD>
[...]
</div>

Manual Encoding: Case 2#

Encode the following passage from act 3, scene 1 of The Belle’s Stratagem by Hannah Cowley.[2] The speaker ID for Letitia is “letitia”, the one for Mrs. Racket is “mrs-racket”. The play is written in prose.

<div type="act" n="3">
<ADD>ACT III.<ADD>
<div type="scene" n="1">
<ADD>SCENE I.<ADD>Mr. Hardy's.<ADD><ADD>
<ADD>Enter Letitia and Mrs. Racket.<ADD>
<ADD>
<ADD>Mrs. Racket.<ADD>
<ADD>Come, prepare, prepare; your Lover is coming.<ADD>
<ADD>
<ADD>
<ADD>Letit.<ADD>
<ADD>My Lover!—Confess now that my absence at dinner was a severe mortification to him.<ADD>
<ADD>
<ADD>
<ADD>Mrs. Rack.<ADD>
<ADD>I can't absolutely swear it spoilt his appetite; he eat as if he was hungry, and drank his wine as though he liked it.<ADD>
<ADD>
<ADD>
<ADD>Letit.<ADD>
<ADD>What was the apology?<ADD>
<ADD>
<ADD>
<ADD>Mrs. Rack.<ADD>
<ADD>That you were ill;—but I gave him a hint, that your extreme bashfulness could not support his eye.<ADD>
<ADD>
<ADD>
<ADD>Letit.<ADD>
<ADD>If I comprehend him, aukwardness and bashfulness are the last faults he can pardon in a woman; so expect to see me transform'd into the veriest maukin.<ADD>
<ADD>
<ADD>
<ADD>Mrs. Rack.<ADD>
<ADD>You persevere then?<ADD>
<ADD>
<ADD>
<ADD>Letit.<ADD>
<ADD>Certainly. I know the design is a rash one, and the event important;—it either makes Doricourt mine by all the tenderest ties of passion, or deprives me of him for ever; and never to be his wife will afflict me less, than to be his wife and not be belov'd.<ADD>
<ADD>
<ADD>
<ADD>Mrs. Rack.<ADD>
<ADD>So you wo'n't trust to the good old maxim—"Marry first, and love will follow?"<ADD>
<ADD>
<ADD>
<ADD>Letit.<ADD>
<ADD>As readily as I would venture my last guinea, that good fortune might follow. The woman that has not touch'd the heart of a man before he leads her to the altar, has scarcely a chance to charm it when possession and security turn their powerful arms against her.—But here he comes.—I'll disappear for a moment.—Don't spare me.<ADD>
<ADD>
<ADD>Exit Letitia.<ADD>
[...]
</div>
</div>

Exercise 3: Semi-Automatic Encoding with EzDrama#

Encode the following passage from the beginning of act 1, scene 1 of The Beau Defeated, or The Lucky Younger Brother by Mary Pix, using EzDrama syntax.[3]

ACT I. SCENE I.
Enter Mrs. Rich with Betty, her Maid.
Betty.
What's the matter, Madam? What has happen'd to you? What has any body done to you?
Mrs. Rich.
An Affront? ... Ah! I die: An affront! ... I faint: I cannot speak. A Chair quickly.
Betty.
[Giving a Chair.] An affront! to you, Madam, an affront! Is it possible!
Mrs. Rich.
But too true, my poor Betty. Oh! I shall dye. To disrespect me in the open Street! What Insolence!
Betty.
How, Madam! Not to show respect to such a person as you? Madam Rich; the Widow of an honest Banker, who got Two Hundred Thousand Pounds in the King's service? Pray, Madam, who has been thus insolent?
Mrs. Rich.
A Dutchess; who had the confidence to thrust my Coach from the Wall, and make it run back above twenty yards.

Convert the encoded text to TEI/XML using one of the methods suggested in the EzDrama repository [DraCor, 2022–present]. Look at the resulting TEI/XML file. Given your current understanding of TEI/XML, does it look correct? Are there things that need to be corrected manually? If so, where would it make more sense to introduce a correction in each case: the EzDrama input, or the TEI/XML output?

Exercise 4: Encoding with LLMs#

Pick an entire play of your choice that is available to you in plain text and in the public domain. As an option, you may visit dracor.org and access the full text of any drama in plain text in the ‘Full text’ tab [Fischer et al., n.d.] (see Chapter 4, “Front-end: Navigating DraCor”). Try prompting an LLM of your choice to encode the play in TEI. Assess the results. Was the LLM able to process the whole play? Did it omit anything? Do you notice any obvious hallucinations? Are there any obvious markup errors?

If the play could not be processed in one go, try encoding it in chunks. You can also try different strategies: with / without examples of TEI-encoded drama, with / without explicitly mentioning DraCor, with / without explicitly asking to mark speeches, stage directions, and so on. Do you see any differences? Reflect on the current state of LLM-powered encoding and its limitations.

References#

[fis]

Dracor.org Platform. URL: https://dracor.org/ (visited on 2026-04-12).

[drant]

Easy Drama (EzDrama). 2022–present. URL: dracor-org/ezdrama (visited on 2026-04-12).

[Bai89]

Joanna Baillie. De Monfort: A Tragedy. In A Series of Plays: In Which It Is Attempted To Delineate The Stronger Passions of the Mind: Each Passion Being the Subject of a Tragedy and a Comedy, volume 1, pages 301–411. T. Cadell, Junior and W. Davies, London, 1789. URL: https://en.wikisource.org/wiki/A_Series_of_Plays_in_which_it_is_attempted_to_delineate_The_Stronger_Passions_of_the_Mind,_Volume_One/De_Monfort (visited on 2026-04-19).

[Cow24]

Hannah Cowley. The Belle's Stratagem. October 2024. URL: https://gutenberg.org/ebooks/47604 (visited on 2026-04-19).

[Pix]

Mary Pix. The Beau Defeated, or The Lucky Younger Brother. URL: https://dracor.org/id/eng000527 (visited on 2026-04-12).

Footnotes#