Module packages.resilient.bible.tei
TEI bible format with critical apparatus as used for the Gothic Bible.
This implements the subset of TEI used in the Gotica XML document from project "wulfila.be" (TEI Gothica).
HIGHLY EXPERIMENTAL
Info:
- Copyright: (c) 2022-2025 Omikhleia / Didier Willis
- License: MIT
Class packages.resilient.bible.tei
package:_init (_) | (Constructor) Initialize the package. |
package:outputCollatedNotes () | Outputs the collated notes for the current page. |
packages.resilient.bible.tei.isStructure (content) | Check if a content tree contains commands, in which case it is assumed to be a "structure". |
packages.resilient.bible.tei.filterDifferences (rdg) | Filter function to find relevant difference readings. |
packages.resilient.bible.tei.postprocessReadings (content) | Postprocess two readings to link corresponding segments. |
packages.resilient.bible.tei.processCapitalize (content) | Recursively walks through a content tree to find the first non-empty string and capitalize it. |
packages.resilient.bible.tei.startsWithPunct (content) | Check if a content tree (assumed already trimmed) starts with a punctuation element <c> . |
packages.resilient.bible.tei.trimAllSubContents (content) | Recursively walks through a content tree to trim all text nodes. |
packages.resilient.bible.tei.weightReading (content) | Recursively walks through a content tree to compute a weight for a reading. |
packages.resilient.bible.tei.preprocessReading (content) | Preprocess a reading content tree to extract readings. |
packages.resilient.bible.tei.handleStartsWithLacuna (rdgA, rdgB) | Handle the case where the first reading starts with a lacuna
A |
packages.resilient.bible.tei.handleEndsWithLacuna (rdgA, rdgB) | Handle the case where the first reading ends with a lacuna |
packages.resilient.bible.tei.handleByWeight (rdgA, rdgB) | Handle best readings (recursing into them to compute a weight). |
packages.resilient.bible.tei.weightStructure (content) | Walk an apparatus (<app> ) content tree to weight and select readings (<rdg> ). |
package:registerCommands () | (Override) Register package-specific commands. |
package:registerStyles () | (Override) Register package-specific styles. |
Class packages.resilient.bible.tei
Extends packages.resilient.base.
- package:_init (_)
-
(Constructor) Initialize the package.
Parameters:
- _ table Package options (not used here)
- package:outputCollatedNotes ()
- Outputs the collated notes for the current page.
- packages.resilient.bible.tei.isStructure (content)
-
Check if a content tree contains commands, in which case it is assumed to be a "structure".
FIXME LIKELY BROKEN BY DESIGN, CHECK WHERE USED FOR REFACTORING OR CLARIFYING
Parameters:
- content table Content tree
Returns:
-
boolean
True if structured content
- packages.resilient.bible.tei.filterDifferences (rdg)
-
Filter function to find relevant difference readings.
For
<seg>
elements, we ignore punctuation differences (subtype 5)Parameters:
- rdg table A reading
Returns:
-
boolean
True if relevant
- packages.resilient.bible.tei.postprocessReadings (content)
-
Postprocess two readings to link corresponding segments.
Parameters:
- content table Content tree
- packages.resilient.bible.tei.processCapitalize (content)
-
Recursively walks through a content tree to find the first non-empty string and capitalize it.
NOTE: Processes all the content.
Parameters:
- content table Content tree
- packages.resilient.bible.tei.startsWithPunct (content)
-
Check if a content tree (assumed already trimmed) starts with a punctuation element
<c>
.(TEI Gotica-specific)
Parameters:
- content table Content tree
- packages.resilient.bible.tei.trimAllSubContents (content)
-
Recursively walks through a content tree to trim all text nodes.
The lowest-level
<seg>
element can contain<unclear>
,<add>
and<del>
elements. The assuption is that these only contain a word parts (i.e. strings). We extract the target word (incl. additions), the source word (including deletions).(TEI Gotica-specific)
Parameters:
- content table Content tree
- packages.resilient.bible.tei.weightReading (content)
-
Recursively walks through a content tree to compute a weight for a reading.
Parameters:
- content table Content tree
- packages.resilient.bible.tei.preprocessReading (content)
-
Preprocess a reading content tree to extract readings.
Parameters:
- content table Content tree
- packages.resilient.bible.tei.handleStartsWithLacuna (rdgA, rdgB)
-
Handle the case where the first reading starts with a lacuna
A
<seg type="diff" subtype="6">
is used in the source document to mark difference in one variant where the other has a lacuna.(TEI Gotica-specific)
Parameters:
- packages.resilient.bible.tei.handleEndsWithLacuna (rdgA, rdgB)
-
Handle the case where the first reading ends with a lacuna
Parameters:
Returns:
-
boolean
True if handled
- packages.resilient.bible.tei.handleByWeight (rdgA, rdgB)
-
Handle best readings (recursing into them to compute a weight).
Pick the reading that has more words (longer), or less unclear forms.
Parameters:
- packages.resilient.bible.tei.weightStructure (content)
-
Walk an apparatus (
<app>
) content tree to weight and select readings (<rdg>
).(TEI Gotica-specific)
Parameters:
- content table Apparatus content tree
- package:registerCommands ()
- (Override) Register package-specific commands.
- package:registerStyles ()
- (Override) Register package-specific styles.