Type definition
Properties
Unique identifier for the segment. Typically follows patterns like
P1234, B567a, H890 depending on the source corpus.The Arabic text content of the segment. Can include Arabic script, diacritics, and punctuation.
Usage
TheSegment type is the fundamental input unit for wobble-bibble. It represents a single piece of Arabic text that needs translation.
Creating segments
With validation
With prompt formatting
Segment ID patterns
Common ID prefixes used in Islamic texts:| Prefix | Source Type | Example |
|---|---|---|
P | General paragraph | P1234 |
H | Hadith | H567 |
B | Book section | B890a |
V | Verse reference | V2:255 |
F | Fatwa | F123 |
Segment IDs must remain consistent between input and output. The validator checks for invented IDs, duplicates, and missing gaps.
Related types
- ValidationError - Includes optional
idfield linking errors to segments - ValidationResponseResult - Uses
Segment[]as input
Related functions
- formatExcerptsForPrompt - Formats segments for LLM input
- validateTranslationResponse - Validates translations against segments