Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Transform Taxonomy

Status: Current Classification of the 23 transform commands by operation level.

Text/Layout Transforms (5)

These transforms operate on serialized CHAT text, not the AST. They handle formatting concerns that have no structural representation in the data model.

CommandOperationWhy Text-Level
LONGTIERRemove continuation line wrapping (\n\t → single line)Line wrapping is a display concern
LINESAdd/remove line number prefixesLine numbers have no AST representation
INDENTAlign CA overlap markers by columnColumn alignment is visual, not structural
LOWCASELowercase main tier wordsOperates on AST (Word.text), but simple enough to be text-like
CHSTRINGFind/replace strings using a changes fileText substitution by design

Structured/AST Transforms (15)

These transforms modify the parsed AST and re-serialize. They use typed model fields, not string manipulation.

CommandOperationKey AST Types
QUOTESExtract quoted text to separate utterancesUtterance, Postcode
ORTOrthographic conversion via dictionaryWord.text
RETRACECopy main tier to %ret dependent tierMainTier → DependentTier
COMBTIERMerge duplicate dependent tiersDependentTier list
POSTMORTEMPattern rules on %mor itemsMorTier.items (partially; %mor rewrite pending)
FLOGenerate %flo tier (simplified fluent output)MainTier.content → DependentTier::Flo
FIXBULLETSRepair timing bullet orderingBullet.timing (start_ms, end_ms)
TIERORDERReorder dependent tiers to canonical orderUtterance.dependent_tiers
TRIMRemove selected dependent tiersUtterance.dependent_tiers.retain()
MAKEMODGenerate %mod tier from pronunciation lexiconWord → DependentTier::Mod
COMPOUNDNormalize compound word formatting (dash → plus)Word.text compound markers
REPEATMark utterances with revisions as [+ rep]Utterance retrace annotations
ROLESRename speaker codesSpeakerCode in headers + utterances
DATESCompute participant ages from @Birth/@DateHeader::ID age field
DELIMAdd missing terminatorsMainTier.terminator

Mixed/Hybrid Transforms (3)

These transforms use a combination of AST and text-level operations.

CommandOperationNotes
DATACLEANFix CHAT formatting errors (brackets, tabs, ellipsis)Text-level by design: fixes sub-token formatting that the parser accepts as-is
FIXITNormalize via parse-serialize roundtripAST transform is a no-op; normalization comes from the serializer’s canonical formatting
GEMExtract utterances within @Bg/@Eg gem boundariesAST-based: filters ChatFile.lines by gem header state

Pipeline Patterns

Standard AST pipeline (most transforms)

read file → parse → validate → transform(AST) → serialize → write

Handled by framework::run_transform().

Text-level pipeline (DATACLEAN, LINES)

read file → parse → validate → serialize → transform(text) → write

Uses custom run functions that operate on the serialized string.

File-argument pipeline (COMPOUND, DATES)

copy to temp → run with file path → read output

Some CLAN binaries don’t support stdin; these use file arguments.