BiDi object. Note: this structure is not thread safe. It is not safe to use value of this type simultaneously from multiple threads.
Moduletext-icu-0.8.0.5Haskell98
Data.Text.ICU.BiDi
Implementation of the Unicode Bidirectional Algorithm. See the documentation of the libicu library for additional details.
- Note: this module is not thread safe. Do not call the functions on one BiDi object from more than one thread!
- 2 types
- 9 values
- Packagetext-icu-0.8.0.5
- Exports11
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceBiDi.hsc
Basic functions
2 declarationsAllocate a BiDi structure.
openSized :: Int32is the maximum text or line length that internal memory will be preallocated for. An attempt to associate this object with a longer text will fail, unless this value is 0.
-> Int32is the maximum anticipated number of same-level runs that internal memory will be preallocated for. An attempt to access visual runs on an object that was not preallocated for as many runs as the text was actually resolved to will fail, unless this value is 0.
-> IO BiDi
Allocate a BiDi structure with preallocated memory for internal structures.
Set data
2 declarationssetPara Perform the Unicode Bidi algorithm. It is defined in the Unicode Standard Annex #9, version 13, also described in The Unicode Standard, Version 4.0. This function takes a piece of plain text containing one or more paragraphs, with or without externally specified embedding levels from styled text and computes the left-right-directionality of each character.
setLine Sets a BiDi to contain the reordering information, especially the resolved levels, for all the characters in a line of text
Access the BiDi object
3 declarationsGet the number of paragraphs.
getParagraphByIndex Get a paragraph, given the index of this paragraph.
Get the length of the source text processed by the last call to setPara.
Output text
2 declarationsConstructors
DoMirroringreplace characters with the "mirrored" property in RTL runs by their mirror-image mappings
InsertLrmForNumericsurround the run with LRMs if necessary; this is part of the approximate "inverse Bidi" algorithm
KeepBaseCombiningkeep combining characters after their base characters in RTL runs
OutputReversewrite the output in reverse order
RemoveBidiControlsremove Bidi control characters (this does not affect InsertLrmForNumeric)
Instances1Show
Show WriteOptionDefined in text-icu-0.8.0.5 · Data.Text.ICU.BiDi
High-level functions
1 declarationHelper function to reorder a text to a series of paragraphs.