tessl install tessl/pypi-python-levenshtein@0.27.0Python compatibility wrapper for computing string edit distances and similarities using fast Levenshtein algorithms.
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.38x
Baseline
Agent success rate without this tile
64%
Build a string transformation system that can record, apply, and reverse text editing operations. The system should track changes made to strings and allow replaying or undoing those changes.
Transform Tracker: Create a class TransformTracker that records how to transform one string into another.
Apply Transformation: Implement a method apply_transformation(source_text) that:
Reverse Transformation: Implement a method get_reverse_tracker() that:
TransformTracker objectTransformation Details: Implement a method get_operation_count() that:
Provides fast string edit distance and transformation operations.
# test_transform.py
from transform import TransformTracker
def test_basic_transformation():
tracker = TransformTracker("hello", "hallo")
result = tracker.apply_transformation("hello")
assert result == "hallo"
assert tracker.get_operation_count() == 1# test_transform.py
def test_reverse_transformation():
tracker = TransformTracker("cat", "dog")
reverse = tracker.get_reverse_tracker()
# Apply forward then reverse
forward_result = tracker.apply_transformation("cat")
assert forward_result == "dog"
reverse_result = reverse.apply_transformation("dog")
assert reverse_result == "cat"# test_transform.py
def test_complex_transformation():
tracker = TransformTracker("kitten", "sitting")
result = tracker.apply_transformation("kitten")
assert result == "sitting"
assert tracker.get_operation_count() > 1