Bidi::ParagraphBidiInfo
Single-paragraph bidirectional analysis for UTF-8 text
Simplified API for text known to contain only one paragraph.
Provides the same functionality as BidiInfo but with a simpler interface
since paragraph handling is not needed.
Properties:
text: The original input text (single paragraph)original_classes: BidiClass for each byte in the textlevels: Embedding level for each byte in the textparagraph_level: Base embedding level for the paragraphis_pure_ltr: Whether the paragraph contains only LTR content
This matches the Rust ParagraphBidiInfo<'text> struct.
Constructors
new(text : String, original_classes : Array(BidiClass), levels : Array(Level), paragraph_level : Level, is_pure_ltr : Bool)
SourceCreates a new ParagraphBidiInfo by analyzing single-paragraph text
Parameters:
text: The UTF-8 text to analyze (should be a single paragraph)default_para_level: Optional base paragraph level (nil for auto-detection)
Returns: ParagraphBidiInfo with analysis results
new_with_data_source(data_source : BidiDataSource, text : String, default_para_level : Level | Nil = nil) : ParagraphBidiInfo
Creates a new ParagraphBidiInfo with a custom data source
Lower-level constructor for custom Unicode data sources.
Most users should use ParagraphBidiInfo.new() instead.
Parameters:
data_source: CustomBidiDataSourcefor bidi class lookupstext: The UTF-8 text to analyzedefault_para_level: Optional base paragraph level
Returns: ParagraphBidiInfo with analysis results
Class methods
Instance methods
direction
Sourcehas_rtl?
Sourceis_pure_ltr
Sourcelevels
Sourceoriginal_classes
Sourceparagraph_level
Sourceparagraph_level=(paragraph_level : Level)
Sourcetext
Source