-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide get_base_direction_full API to consider the whole text
The get_base_direction function (from #117) considers only the first paragraph of the given text; but if this has no strong characters, some callers may want to consider subsequent paragraphs as well rather than just return Mixed. This is trivial to implement by simply resetting the isolate count when encountering a block separator, instead of returning at that point. (It might've been better to expose a first_paragraph_only boolean parameter to the original get_base_direction, but I presume we don't want to modify public API, hence the separate ...full version of the function, sharing the internal implementation.
- Loading branch information
Showing
1 changed file
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters