On this page:
Digital Ricœur TEI Library

Digital Ricœur TEI Library

Philip McGrath <philip at philipmcgrath dot 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.

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 High-level Corpus Functionality

      2.1 Working with Corpus Objects

      2.2 Creating Corpus Objects

      2.3 Deriving New Corpus Classes

      2.4 Search Results

      2.5 Searching Without a Corpus Object

    3 Bibliographic Information

      3.1 Instance Sets

      3.2 Derived Instance Info

        3.2.1 Class-based Objects

    4 Document-level Functions

      4.1 Reading & Writing TEI Documents

      4.2 Paragraph Inference

    5 Document Segments

      5.1 Segment Basics

      5.2 Working with Segments

      5.3 Implementing New Types of Segments

    6 TEI Element Representation

      6.1 TEI X-Expression Contracts

      6.2 Common Element Interface

        6.2.1 Struct–X-Expression Conversion

        6.2.2 Traversing TEI Element Structs

      6.3 Specialized Element Interfaces

        6.3.1 Elements with Responsible Parties

        6.3.2 Page-break Elements

        6.3.3 Footnote & Endnote Elements

        6.3.4 Chapter & Section Elements

    7 X-Expression and XML Operations

      7.1 Raw X-Expressions

        7.1.1 Plain-Text Conversion

      7.2 Normalized X-Expressions

      7.3 xmllint-based Operations

    8 General Utilities

    9 Implementation Details

      9.1 Specification Language

        9.1.1 Language Objectives

        9.1.2 Module Structure

 The spec-name-declaration

 The spec-module-body Forms

 Runtime Submodules

        9.1.3 Defining TEI Elements

 Struct Type Definition Overview

 Field Definition Forms

 Supporting Standard Interfaces

 Implementing Additional Forms

        9.1.4 Linking & Invoking

 Additional Helper Functions

        9.1.5 Documentation Phase

 Using the Documentation

      9.2 Search Implementation

        9.2.1 Constructing Search Results

        9.2.2 Implementing Search Backend Types

 Basic search^ Units

      9.3 “TEI Lint” Implementation

        9.3.1 Interfaces

 Document Frame Components

 Menu Bars

        9.3.2 More

        9.3.3 Utility Library

        9.3.4 Application Icons