Type definition
Properties
Optional array of speaker labels to recognize when fixing collapsed speaker lines.If omitted, the fixer will attempt to infer labels from the text automatically.Examples:
Optional array of punctuation tokens that may appear before a collapsed speaker label.Used to detect patterns like
"... The Shaykh:" where punctuation precedes the label.Default: ['.', '!', '?', '،', '؛']Examples:Usage
With explicit speaker labels
With automatic label inference
Custom punctuation handling
Complete configuration
Label inference
WhenspeakerLabels is omitted, the fixer uses a pattern to detect labels:
- Lines starting with text followed by
: - Label is 1-28 characters
- Maximum 2 words
Punctuation preservation
The fixer preserves trailing punctuation before inserting line breaks:Before fix
After fix (punctuation preserved)
Default punctuation
IfleadingPunctuation is omitted, the default includes:
Common patterns
Fatawa Q&A format
Academic dialogue
Minimal configuration
Related types
- FixResult - Return type from fixer functions
- FixAllOptions - Options for batch fixing
- ValidationErrorType -
collapsed_speakerserror type
Related functions
- fixCollapsedSpeakerLines - Uses this config
- fixAll - Accepts config for multiple fixers