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

COMPLEXITY — Syntactic Complexity Ratio

Status: Current Last updated: 2026-05-12 10:07 EDT

Computes syntactic complexity by counting subordinating dependency relations in the %gra tier.

Usage

chatter clan complexity file.cha
chatter clan complexity corpus/ --speaker PAR
chatter clan complexity file.cha --format json

What It Measures

COMPLEXITY reads the %gra dependency tier and counts clause-embedding relations that indicate syntactic subordination. The complexity ratio is the number of subordinating relations divided by total tokens (non-punctuation).

UD Relations (auto-detected)

Per crates/clan/clan-core/src/commands/complexity.rs:10:

RelationDescription
CSUBJClausal subject
CCOMPClausal complement
XCOMPOpen clausal complement
ACLAdnominal clause
ADVCLAdverbial clause modifier
APPOSApposition
EXPLExpletive

Legacy CLAN Relations (auto-detected)

RelationDescription
CSUBJClausal subject
COMPComplement
CPREDClausal predicate
CPOBJClausal object of preposition
COBJClausal object
CJCTClausal adjunct
XJCTNon-finite clausal adjunct
NJCTNominal adjunct
CMODClausal modifier
XMODNon-finite clausal modifier

Output

Per speaker:

  • Count of each subordinating relation
  • Tokens: total matched complexity relations
  • TotalTokens: all non-PUNCT tokens
  • Ratio: Tokens / TotalTokens

Requirements

Requires a %gra dependent tier. Utterances without %gra are skipped.

Differences from CLAN

  • Auto-detects UD vs legacy relation names (CLAN requires compile-time config)
  • Uses typed AST GraTier with GrammaticalRelation entries
  • Supports JSON and CSV output
  • Sub-relations (e.g., CSUBJ:pass) are properly matched to their base relation