RETRACE – Add %ret Dependent Tier with Verbatim Main-Tier Copy
Status: Current
Purpose
Reimplements CLAN’s retrace command, which adds a %ret: dependent tier to each utterance containing a verbatim serialized copy of the main-tier content (including retrace markers, pauses, events, etc.). This serves as a reference tier preserving the original utterance text before other transforms modify it.
See the CLAN manual for the original command documentation.
Usage
chatter clan retrace file.cha
Options
This command has no configurable options.
Behavior
For each utterance, the transform:
- Serializes the main tier to its full CHAT text representation.
- Extracts the content portion (after
*SPEAKER:\t). - Creates a
%ret:user-defined dependent tier containing the verbatim content. - Inserts the
%ret:tier at position 0 (before other dependent tiers).
All headers are preserved. Existing dependent tiers are kept.
Differences from CLAN
- Operates on AST rather than raw text.
- Uses the framework transform pipeline (parse -> transform -> serialize -> write).