GGlyphMetrum
AI coding workspace

Levenshtein edit distance

GlyphMetrum is a Windows AI coding client for examining text algorithms in their source context. Use the conversation to reason about code-point edits, then inspect the implementation and its Unicode tests.

● ● ●GlyphMetrum●
A concrete starting point · Levenshtein edit distance ×
def edit_distance(a, b):
    if not isinstance(a, str) or not isinstance(b, str):
        raise ValueError("text.required")
    previous = list(range(len(b) + 1))
    for i, left in enumerate(a, 1):
        current = [i]
        for j, right in enumerate(b, 1):
            current.append(min(current[-1] + 1, previous[j] + 1,
                               previous[j - 1] + (left != right)))
        previous = current
    return previous[-1]
✳Measure Levenshtein distance by Unicode code point without normalizing the strings.
✓ ChangesReview before applying ↗
Illustrative workspace
  1. Review before applying

    Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

  2. Connection

    Base URL, credentials and a reachable server.

  3. Project

    Check empty input, one emoji substitution and composed versus decomposed text, counting the original sequences rather than claiming visual-character equivalence.

Workflows

Levenshtein edit distance

Workflows ↗
A concrete starting point
def edit_distance(a, b):
    if not isinstance(a, str) or not isinstance(b, str):
        raise ValueError("text.required")
    previous = list(range(len(b) + 1))
    for i, left in enumerate(a, 1):
        current = [i]
        for j, right in enumerate(b, 1):
            current.append(min(current[-1] + 1, previous[j] + 1,
                               previous[j - 1] + (left != right)))
        previous = current
    return previous[-1]
AI coding workspace

Define what a text match should mean before coding it

GlyphMetrum is a Windows coding workspace for using a connected AI model to examine text-processing changes in your project. Start by describing the decision the application needs to make: compare input, suggest a nearby label or reject a value that does not qualify. Ask the assistant to inspect the relevant function and its caller before proposing changes, so the conversation connects implementation details to visible behavior.

The distance.py example gives that discussion a concrete starting point through a character-edit comparison. It is a sample project context, not a search engine or matching feature built into GlyphMetrum. Your application may need its own decisions about case, normalization and the amount of difference that is acceptable. Review those decisions separately from the mechanism used to calculate a distance.

Test the resulting behavior with examples whose expected outcomes you can explain, including empty text and visibly similar strings represented differently. Check how the caller handles ties or no acceptable match. Connect a supported OpenAI-compatible or Anthropic endpoint, adding credentials when required; an unrestricted model is selectable only where offered. Model restrictions, available tools and context limits still depend on the configured service. The coding workspace helps organize the work while you decide whether its result fits the application.

Text comparison decisions for a coding task

Does the sample define a complete matching policy?

No. It supplies a comparison mechanism to discuss. Your application must decide which transformations are allowed and what result qualifies as a match, then test those decisions through the caller rather than relying on distance alone.

Should case folding be added automatically?

Only when it matches the intended behavior. Some identifiers are case-sensitive while user-facing labels may not be. Give the assistant representative examples and review where any normalization occurs so it does not affect unrelated text.

How can I check ambiguous suggestions?

Include cases where several candidates are equally close and state how the application should respond. Inspect the selection logic in addition to the comparison function, because a correct distance does not choose a useful tie policy.

Is GlyphMetrum a ready-made fuzzy search service?

No such service is claimed. It is a coding workspace in which you can discuss and review text-processing code in your project. Indexing, application behavior and any search infrastructure remain your implementation responsibilities.

Get the Windows app ↗

GlyphMetrum · Updated 2026-10-25