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%
A utility for computing edit distances between strings with custom operation costs.
Different text correction scenarios require different cost models. For example, in spell-checking, character substitutions might be cheaper than insertions or deletions. In data entry validation, deleting characters might be costlier than adding them. This tool allows configuring custom costs for each edit operation.
@generates
def weighted_distance(str1: str, str2: str, insertion_cost: int = 1, deletion_cost: int = 1, substitution_cost: int = 1) -> int:
"""
Calculate the edit distance between two strings using custom operation costs.
Args:
str1: First string to compare
str2: Second string to compare
insertion_cost: Cost for inserting a character (default 1)
deletion_cost: Cost for deleting a character (default 1)
substitution_cost: Cost for substituting a character (default 1)
Returns:
Integer representing the minimum weighted cost to transform str1 into str2
"""
passProvides fast string distance computation with support for custom edit costs.
@satisfied-by