str distance for strings
Compare two strings and return the edit distance/Levenshtein
distance.
Signature
> str distance {flags} (compare-string) ...rest
Parameters
-
compare-string: the first string to compare -
...rest: For a data structure input, check strings at the given cell paths, and replace with result
Input/output types:
| input | output |
|---|---|
| record | record |
| string | int |
| table | table |
Examples
get the edit distance between two strings
> 'rsh' | str distance 'nutshell'
1
Compute edit distance between strings in table and another string, using cell paths
> [{a: 'nutshell' b: 'numetal'}] | str distance 'rsh' 'a' 'b'
╭───┬───┬───╮
│ # │ a │ b │
├───┼───┼───┤
│ 0 │ 1 │ 4 │
╰───┴───┴───╯
Compute edit distance between strings in record and another string, using cell paths
> {a: 'nutshell' b: 'numetal'} | str distance 'rsh' a b
╭───┬───╮
│ a │ 1 │
│ b │ 4 │
╰───┴───╯