Distancia de Levenshtein
levenshtein-distanceCalcula la distancia de edición de Levenshtein entre dos cadenas y similitud normalizada. Cuándo: hay que transformar, comparar o medir un texto con exactitud y no por aproximación. No para: medir la distancia de edición que también cuenta caracteres vecinos intercambiados (damerau-levenshtein). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Computes the edit distance (insertions, deletions, substitutions) between two strings by code point, plus a normalized similarity 1 - d/max(len). Length product capped at 4M. When: text has to be transformed, compared or measured exactly instead of approximated. Not for: measuring edit distance that also counts swapped adjacent characters (damerau-levenshtein). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First string (string; required; up to 20000 chars). | |
| b | Yes | Second string (string; required; up to 20000 chars). | |
| case_sensitive | No | Case sensitive (boolean; optional; default true). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| distance | No | ||
| similarity | No |