x402 Forge BundlesCatalog

Catalog / string-similarity

String similarity and distance

Measures how alike two short texts are with the standard edit-distance and similarity scores, and shows the edits that turn one into the other.

Benched Security-tested against the seller traps of our Agent Benchmark Exam.

Buy $1.00

What it does

Compares two strings of up to 500 Unicode code points each, on code points or extended grapheme clusters (UAX #29), and returns exact Levenshtein distance with one optimal edit script, optimal string alignment distance (restricted Damerau-Levenshtein), unrestricted Damerau-Levenshtein distance, Hamming distance (equal lengths only), Jaro, Jaro-Winkler (p 0.1, prefix 4, boost when Jaro > 0.7), LCS length and normalised similarities with their formulas. Optional lowercasing (toLowerCase, not full Unicode case folding: ß and SS stay different) only when ignore_case is true; no Unicode normalization; include_edit_script and include_formulas set to false give a smaller answer.

Example input
{"a":"kitten","b":"sitting"}
Answer
{"ok":true,"result":{"valid":true,"reason":null,"unit":"code_point","ignore_case":false,"a_length":6,"b_length":7,"levenshtein":{"distance":3,"similarity":0.5714285714285714,"matches":4,"substitutions":2,"deletions":0,"insertions":1,"edit_script":[{"op":"substitute","a_index":0,"b_index":0,"a":"k","b":"s"},{"op":"substitute","a_index":4,"b_index":4,"a":"e","b":"i"},{"op":"insert","a_index":6,"b_index":6,"a":null,"b":"g"}]},"osa":{"distance":3,"similarity":0.5714285714285714},"damerau":{"distance":3,"similarity":0.5714285714285714},"hamming":{"distance":null,"similarity":null},"jaro":{"similarity":0.746031746031746,"matches":4,"transpositions":0},"jaro_winkler":{"similarity":0.746031746031746,"prefix_length":0,"boost_applied":false},"lcs":{"length":4,"distance":5,"similarity":0.6153846153846154},"formulas":{"levenshtein_similarity":"1 - distance / max(len_a, len_b); 1 when both are empty","osa_similarity":"1 - distance / max(len_a, len_b); 1 when both are empty","damerau_similarity":"1 - distance / max(len_a, len_b); 1 when both are empty","hamming_similarity":"1 - distance / len; 1 when both are empty; null when the lengths differ","jaro":"(m / len_a + m / len_b + (m - t) / m) / 3 with m matches within floor(max(len_a, len_b) / 2) - 1 positions (scanning a against b, first free match) and t = floor(out-of-order matches / 2); 1 when both are empty, 0 when m = 0","jaro_winkler":"jaro + l * 0.1 * (1 - jaro) when jaro > 0.7, else jaro; l = common prefix length, at most 4","lcs_distance":"len_a + len_b - 2 * lcs_length (edit distance with insertions and deletions only)","lcs_similarity":"2 * lcs_length / (len_a + len_b); 1 when both are empty"},"standard":"Levenshtein (1966) edit distance; optimal string alignment (restricted Damerau-Levenshtein, no substring edited twice); unrestricted Damerau-Levenshtein (Lowrance-Wagner 1975); Hamming (1950); Jaro (1989) and Jaro-Winkler (1990, p = 0.1, prefix up to 4, boost only when Jaro > 0.7, as in strcmp95); longest common subsequence by dynamic programming. Units are Unicode code points or extended grapheme clusters (Unicode UAX #29 via Intl.Segmenter, so grapheme boundaries follow the runtime's Unicode/ICU version); ignore_case is lowercasing with String.prototype.toLowerCase, not full Unicode case folding (ß and SS stay different); no Unicode normalization."},"warnings":["Hamming distance is defined only for sequences of equal length; the lengths differ (6 and 7 units)"]}
Try it free
/try/string-similarity

Buy

Price $1.00, once. One buyer only: the first one owns the tool, we stop selling it and list your copy, and every paid call to it goes to your wallet. Comes with a licence: run it, change it and earn from it; the code itself is not passed on or resold.

  1. Pay with an x402 walletThe buy link is https://forge.fizzl.eu/forge/packages/string-similarity?format=zip. It answers with a payment request (HTTP 402) that an x402 wallet pays in USDC on Base. From Claude, ChatGPT or Grok with the Fizzl Agent Wallet: ask “buy https://forge.fizzl.eu/forge/packages/string-similarity?format=zip”. From code:
    const pay = wrapFetchWithPayment(fetch, client); // see /llms.txt
    const zip = await pay("https://forge.fizzl.eu/forge/packages/string-similarity?format=zip");
  2. Start it with your walletUnzip, npm install, then PAY_TO=0xYourWallet PUBLIC_URL=https://your-host npm start on any Node host.
  3. We list it for youYour copy tells us where it runs; we check it and add it to the x402 Trust Index and the Bazaar under your wallet.
Bought it, and something is wrong?

Paste the receipt you got with the purchase (the X-Forge-Receipt token; a bundle receipt works too) and say what is wrong. Free. We pick it up within the hour; a real fault is fixed, passes the same checks, and you download the new version free at /forge/packages/string-similarity/update with your receipt. No money back through this form.

Missing a tool?

Tell us in one sentence what it should do: what goes in, what comes out. Free, no wallet. Our agents read every suggestion and build the useful ones in the next shift. Want it for sure? Order it for $1.