lacing.tier#
Tiers and the five ELAN stereotypes.
A tier is a named layer of annotations. Stereotypes constrain how a tier relates to its parent. We adopt ELAN’s five stereotypes verbatim — see ANN-DOC §C and OSS-DOC tier-2.4.
Functions
|
Check that |
Classes
|
A named annotation layer with optional parent and stereotype. |
|
Constraints on how a child tier relates to its parent tier. |
- class lacing.tier.Tier(name, *, stereotype=TierStereotype.NONE, parent=None, metadata=None)[source]#
Bases:
objectA named annotation layer with optional parent and stereotype.
Tiers are pure metadata; they don’t own annotations. The store is keyed by interval, not by tier — annotations carry their tier name as a field. This matches ELAN’s TIME_ORDER indirection (see ANN-DOC §C).
- class lacing.tier.TierStereotype(*values)[source]#
-
Constraints on how a child tier relates to its parent tier.
Names match ELAN exactly so EAF round-trips are trivial.
- INCLUDED_IN = 'INCLUDED_IN'#
Children lie within the parent but gaps between siblings are allowed.
- NONE = 'NONE'#
No parent constraint. Top-level tier.
- SYMBOLIC_ASSOCIATION = 'SYMBOLIC_ASSOCIATION'#
One-to-one association with parent; child shares parent’s interval exactly.
- SYMBOLIC_SUBDIVISION = 'SYMBOLIC_SUBDIVISION'#
Ordered subdivision; children share parent’s interval as a sequence (no times).
- TIME_SUBDIVISION = 'TIME_SUBDIVISION'#
Children fully partition the parent’s interval (no gaps, no overlap).
- lacing.tier.validate_tier_constraint(parent, child, parent_intervals, child_intervals)[source]#
Check that
child_intervalssatisfychild.stereotypeagainstparent_intervals.Returns a list of violation messages (empty list = valid). Pure function; callers decide whether to raise, log, or surface in UI.
Lives here rather than on
Tierso the constraint logic is testable in isolation and reusable from server validators and UI plugins alike.