Type definition
Properties
Minimum number of consecutive ALL CAPS words to trigger an
all_caps error.Default: 5Detects “shouting” patterns in translations like:Default configuration
Usage
Using default configuration
Custom configuration
Stricter validation
Lenient validation
Configuration rationale
Why detect ALL CAPS?
LLMs sometimes use ALL CAPS to emphasize important terms or when uncertain. This can indicate:- Translation uncertainty - The model doesn’t know the proper rendering
- Safety overrides - Model is flagging potentially sensitive content
- Formatting errors - Lost casing information from source
Threshold tuning
| Threshold | Use Case |
|---|---|
2-3 | Strict academic translations (no emphasis allowed) |
5 (default) | Balanced detection for most Islamic texts |
8-10 | Lenient for texts with legitimate emphasis |
The threshold is for consecutive words.
"THIS IS" = 2 words, "THIS IS VERY IMPORTANT" = 4 words.Future configuration options
The library may expandValidationConfig to include:
If you need additional configuration options, please open an issue on the GitHub repository.
Related types
- ValidationError - Errors produced by validation
- ValidationResponseResult - Contains validation results
Related functions
- validateTranslationResponse - Uses this config type