Python Bidi layout wrapping the Rust crate unicode-bidi
Overall
score
93%
Build a function that processes bidirectional text with explicit control over the paragraph's base direction, allowing you to force left-to-right or right-to-left layout regardless of automatic text analysis.
@generates
def display_with_direction(text: str, direction: str) -> str:
"""
Process bidirectional text with an explicit base direction.
Args:
text: The input text containing bidirectional content
direction: Either 'LTR' for left-to-right or 'RTL' for right-to-left
Returns:
The text reordered for display with the specified base direction
Raises:
ValueError: If direction is not 'LTR' or 'RTL'
"""
passProvides bidirectional text layout algorithm implementation with support for explicit direction control.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-python-bididocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10