or run

tessl search
Log in

Version

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

tessl/pypi-python-levenshtein

tessl install tessl/pypi-python-levenshtein@0.27.0

Python 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%

task.mdevals/scenario-2/

Spell Checker Suggestions

Build a spell checking utility that finds the closest matching words from a dictionary for potentially misspelled input words.

Capabilities

Find closest match

  • Given a dictionary of valid words and a potentially misspelled word, returns the closest matching word based on edit distance @test
  • When the input word exactly matches a dictionary word, returns that word with distance 0 @test
  • When multiple words have equal minimum distance, returns the first match found @test

Implementation

@generates

API

def find_closest_match(word: str, dictionary: list[str]) -> tuple[str, int]:
    """
    Finds the closest matching word from a dictionary.

    Args:
        word: The potentially misspelled word to check
        dictionary: List of valid words to compare against

    Returns:
        A tuple containing (closest_word, distance) where closest_word
        is the best match from the dictionary and distance is the
        minimum edit distance found
    """
    pass

Dependencies { .dependencies }

Levenshtein { .dependency }

Provides string edit distance calculation support.