or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/python-bidi@0.6.x
tile.json

tessl/pypi-python-bidi

tessl install tessl/pypi-python-bidi@0.6.0

Python Bidi layout wrapping the Rust crate unicode-bidi

Agent Success

Agent success rate when using this tile

93%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.09x

Baseline

Agent success rate without this tile

85%

task.mdevals/scenario-3/

Text Direction Controller

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.

Capabilities

Process text with forced left-to-right direction

  • Given Hebrew text "שלום:" processed with LTR direction, the output places punctuation at the end @test
  • Given mixed text "hello שלום world" processed with LTR direction, the output maintains left-to-right paragraph flow @test

Process text with forced right-to-left direction

  • Given English text "Hello, World!" processed with RTL direction, the output applies right-to-left paragraph structure @test
  • Given text "English text שלום" processed with RTL direction, the RTL base direction overrides the natural LTR start @test

Implementation

@generates

API

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'
    """
    pass

Dependencies { .dependencies }

python-bidi { .dependency }

Provides bidirectional text layout algorithm implementation with support for explicit direction control.

@satisfied-by