What is the TEI and Why Should I Care?


Joey Takeda, SFU DHIL

January 19, 2021

The TEI

A set of guidelines for encoding text

A non-profit organization

A community or consortium of users

Website: https://tei-c.org/

The TEI

Is a markup language written in XML

Currently in its 5th major revision (P5 4.1.0)

Used by many projects across the world in many different languages and for many different reasons

Within the noisy market place of the Digital Humanities, the TEI is a kind of senior member, an annoying parental figure for some, a benevolent one for others, something just too old-fashioned even to be considered for others.
Yet, over the last decade, it has become increasingly clear that the TEI is part of what makes the digital humanities happen.
(Burnard, "Conclusion", para. 1)

What the TEI is not

A language that describes how a text should be displayed online or in print: "performative and expressive significance of the input" vs "the aesthetics of the output".

A programming language: encoding your texts in TEI does not automatically do anything to them

Caveat: There are many, many tools for transforming TEI into other formats (Word documents, PDFs, and, of course, websites)

Encoding, markup, et cetera...

At its core, textual encoding is a way of identifying and differentiating bits of text from other bits of texts.

We do this all the time!

Italics for emphasis

Underlining for titles

Bold for extra-emphasis

Quotation marks for outside attribution or skepticism

All capitals to YELL

+++

Encoding, markup, et cetera

But these are contextual and local

E.g. different types of punctuation for levels of quotation

And they are subject to varying interpretations

E.g. I think these quotation marks denote a term, but maybe the author is just being sarcastic...

Why should we encode texts?

Accessibility

Distribution

Flexibility

Interoperability

Convertibility (i.e. from one format to another)

Analysis (Distant Reading, et cetera)

Answering existing (and asking new) research questions

XML

XML = eXtensible Markup Language

XML is not a set language unto itself, but a grammar

There is nothing inherent about the function of XML

It is purely a structure--a way of organizing

Anyone can conceive of an XML dialect (e.g. it is extensible)

XML is Everywhere

HTML (HyperText Markup Language: Every website)

KML (Keyhole Markup Language: Google Maps)

RDF (Resource Description Framework: Library catalogues)

SVG (Scalable Vector Graphics: Digital Images)

OOXML (Open Office XML: This presentation, word documents, et cetera)

XML

XML is hierarchical

XML is a tree-like structure

And is often described in genealogical terms

XML

Think of the hierarchy of the book:

Book

Chapters

Sections

Paragraphs

Sentences

Words

Letters

XML


 <book>
    <chapter>
        <section>
            <paragraph>
                <sentence>
                    <word>
                        <letter></letter>
                    </word>
                </sentence>
            </paragraph>
        </section>
    </chapter>
</book> 
             
                
            

XML Explained

The two pointy brackets is called an element

E.g. <book> would be called the book element

All elements have start and end tags

E.g. <book> is the start tag and </book> is the end tag

XML Explained

Elements can also have attributes and each attribute must have a value

E.g. <book type= "primary"> has a type attribute with the value of primary

(Think of attributes as you would in everyday life; people don't have "height" or "age" without a value)

XML Explained

Elements cannot overlap

<sentence><word>Word1</word></sentence> is right

<sentence><word>Word1</sentence></word> is wrong

Elements nest and use genealogical terms

There is always a root element

The TEI Solution

All texts must be called <text>

All divisions (whether they be chapters, sections, et cetera) must be called <div>

All paragraphs must be called <p>

All words must be called <w>

+++

Components of a (basic) TEI file

Root <TEI> element

A <teiHeader> that describes both the file and the primary source that you are transcribing (if applicable)

A <text> that contains the text of the document

Within text, you can have a <front>, <body>, or <back>

TEI

                
<TEI xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader>
      <fileDesc>
         <titleStmt>
            <title>Title</title>
         </titleStmt>
         <publicationStmt>
            <p>Publication Information</p>
         </publicationStmt>
         <sourceDesc>
            <p>Information about the source</p>
         </sourceDesc>
      </fileDesc>
  </teiHeader>
  <text>
      <body>
         <p>Some text here.</p>
      </body>
  </text>
</TEI>
                
            

The TEI

Offers a rich vocabulary and method to encode:

Bibliographic and structural features: page breaks, headers, footers, page numbers, line breaks, divisions, paragraphs, line groups, etc

Interpretative features: stage movement, emphasis, place names, proper names, dialogue direction, etc

Editorial apparatus: hands, witnesses, collation, gaps, additions, deletions, etc

Linguistic features: morphemes, feature structures, orthographic form, etc

Spoken features: incidents, pauses, shifts, "communicative phenomenon", etc

Metadata: various classification schemes, provenance, manuscript description, etc

+++++

TEI

Note that the TEI is huge (569 elements)

No one uses the entirety of the TEI tagset

Individual projects customize the TEI for their own needs, usually using a small subset of the overall tagset

E.g. Drama projects will use the drama tagset (<sp> for speech, <speaker> for speaker, et cetera) and discard the linguistic/dictionary tagset (<entry> for dictionary entries, <m> for morpheme, etc).

What to encode?

Input =/= Output

Encode what you care about and what you have time to encode

If you don't encode it, you can't do much with it

Why not use something else?

Document centric vs. data-centric

XML is criticized for being verbose and complex

But so are texts!

And the TEI is full of documentation

The Guidelines: Some Examples

Example Projects

The Gendered Personification Index

https://dhil.lib.sfu.ca/gpi/

The Pulter Project

https://pulterproject.northwestern.edu

Van Gogh Letters

https://teipublisher.com/exist/apps/vangogh/index.html

How to Get Started?

TEI by Example

https://teibyexample.org/

Questions?

Thanks for listening!

Acknowledgments

  • The DHIL (Remi Castonguay, Rebecca Dowson, Michael Joyce, Sophia Han, Saba Akhyani)
  • Keshav Mukunda, Catherine Louie, and the Research Commons