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-22 09:47 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/talkbank-clan/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.

CLAN +-flag coverage audit

COMPLEXITY has no command-specific +-flags in CLAN’s usage(), the entire flag surface is the inherited general set, except that COMPLEXITY’s getflag() has special handling for +s patterns containing bracket-prefixed postcodes ([+ ...] / [~+ ...] / [+ +...]).

Inherited general flags: same as FREQ. chatter’s Complexity clap struct uses the standard CommonAnalysisArgs. Audit summary: 6 Done / 1 Partial / 4 Rewriter only / 3 Missing.

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