This is an implementation of the Unicode Bidirectional algorithm. The algorithm is defined in the Unicode Technical Report 9, version 5, also described in The Unicode Standard, Version 3.0 .
The <quote>limit</quote> of a sequence of characters is the position just after their last character, i.e., one more than that position.
Some of the API functions provide access to <quote>runs</quote>. Such a <quote>run</quote> is defined as a sequence of characters that are at the same embedding level after performing the BIDI algorithm.