On this page:
Digital Ricœur TEI Library

Digital Ricœur TEI Library

Philip McGrath <philip@philipmcgrath.com>

This manual documents a Racket library for working with Digital Ricœur’s TEI XML documents. In addition to being valid and well-formed XML, the documents should conform to the structure specified in TEI Encoding Guidelines for Digital Ricœur. It also documents Digital Ricœur’s “Term Search” Tool.

This document is written for programmers intending either to use this library in their own programs or to contribute to its implementation. It assumes familiarity with the concept of x-expressions from Racket’s xml library (see the grammar documented under xexpr?).

The ricoeur/tei library provides all of the bindings documented in this manual, except where otherwise noted. The ricoeur/tei/base library provides most of ricoeur/tei, but omits some derived functionality to achieve a slightly faster startup time, making it particularly suitable for command-line scripts.

In addition to the bindings implemented as part of this library, both ricoeur/tei and ricoeur/tei/base re-export everything from adjutor, gregor, and data/maybe, as well as fmap (the version of map from data/functor) and comment?, p-i?, valid-char?, and cdata? from xml.

Not part of Digital Ricœur? Welcome! You probably want to read about the Status of This Library before going much further.

    1 Installing & Updating This Library

      1.1 Additional Installation Details

      1.2 Status of This Library

    2 Bibliographic Information

      2.1 Instance Sets

      2.2 Derived Instance Info

        2.2.1 Class-based Objects

    3 High-level Corpus Functionality

      3.1 Working with Corpus Objects

      3.2 Creating Corpus Objects

      3.3 Deriving New Corpus Classes

    4 “Term Search” Tool

      4.1 Search Results

      4.2 Searching Without a Corpus Object

    5 Document-level Functions

      5.1 Reading & Writing TEI Documents

      5.2 Paragraph Inference

    6 Document Segments

      6.1 Segment Basics

      6.2 Working with Segments

      6.3 Implementing New Types of Segments

    7 TEI Element Representation

      7.1 TEI X-Expression Contracts

      7.2 Common Element Interface

        7.2.1 Struct–X-Expression Conversion

        7.2.2 Traversing TEI Element Structs

      7.3 Specialized Element Interfaces

        7.3.1 Elements with Responsible Parties

        7.3.2 Page-break Elements

        7.3.3 Footnote & Endnote Elements

        7.3.4 Chapter & Section Elements

    8 X-Expression and XML Operations

      8.1 Raw X-Expressions

        8.1.1 Plain-Text Conversion

      8.2 Normalized X-Expressions

      8.3 xmllint-based Operations

    9 General Utilities

    10 Implementation Details

      10.1 Specification Language

        10.1.1 Language Objectives

        10.1.2 Module Structure

 The spec-name-declaration

 The spec-module-body Forms

 Runtime Submodules

        10.1.3 Defining TEI Elements

 Struct Type Definition Overview

 Field Definition Forms

 Supporting Standard Interfaces

 Implementing Additional Forms

        10.1.4 Linking & Invoking

 Additional Helper Functions

        10.1.5 Documentation Phase

 Using the Documentation

      10.2 Search Implementation

        10.2.1 Constructing Search Results

        10.2.2 Implementing Search Backend Types

 Basic search^ Units

      10.3 “TEI Lint” Implementation

        10.3.1 Interfaces

 Document Frame Components

 Menu Bars

        10.3.2 More

        10.3.3 Utility Library

        10.3.4 Application Icons