This is a lightweight function equivalent to ICU's ubidi_getBaseDirection, which just determines the base direction of a piece of text. This is intended for use when the caller just wants the base directionality, and no further bidi processing will be required.
Returns Direction::Ltr or Direction::Rtl according to the first strong character (bidi type L, R, or AL) found in the text (outside of isolate embeddings).
If no strong character is found, returns Direction::Mixed (meaning Neutral in this context, but to avoid breaking API compatibility I didn't want to add a Neutral value to the Direction enum, and creating a new BaseDirection enum here seemed like overkill).
This is a lightweight function equivalent to ICU's ubidi_getBaseDirection, which just determines the base direction of a piece of text. This is intended for use when the caller just wants the base directionality, and no further bidi processing will be required.
Returns Direction::Ltr or Direction::Rtl according to the first strong character (bidi type L, R, or AL) found in the text (outside of isolate embeddings).
If no strong character is found, returns Direction::Mixed (meaning Neutral in this context, but to avoid breaking API compatibility I didn't want to add a Neutral value to the Direction enum, and creating a new BaseDirection enum here seemed like overkill).