莱文斯坦距离

计算把一个字符串改成另一个所需的最少插入、删除和替换次数。

输入: 文本结果: 数值

文本输入

工具选项

案例

another delimiter

输入

kitten sitting

Expected answer

JSON
3
样本分隔符
插入代价
1
删除代价
1
替换代价
1
cost zero

输入

kitten
sitting

Expected answer

JSON
0
样本分隔符
\n
插入代价
0
删除代价
0
替换代价
0
negative deletion cost

输入

kitten
sitting

Expected rejection

Message contains
Negative costs are not allowed.
样本分隔符
\n
插入代价
1
删除代价
-1
替换代价
1
negative insertion cost

输入

kitten
sitting

Expected rejection

Message contains
Negative costs are not allowed.
样本分隔符
\n
插入代价
-1
删除代价
1
替换代价
1
negative substitution cost

输入

kitten
sitting

Expected rejection

Message contains
Negative costs are not allowed.
样本分隔符
\n
插入代价
1
删除代价
1
替换代价
-1
too few samples

输入

kitten

Expected rejection

Message contains
Incorrect number of samples. Check your input and/or delimiter.
样本分隔符
\n
插入代价
1
删除代价
1
替换代价
1
too many samples

输入

kitten
sitting
kitchen

Expected rejection

Message contains
Incorrect number of samples. Check your input and/or delimiter.
样本分隔符
\n
插入代价
1
删除代价
1
替换代价
1
varied costs 1

输入

kitten
sitting

Expected answer

JSON
230
样本分隔符
\n
插入代价
10
删除代价
100
替换代价
1000
varied costs 2

输入

kitten
sitting

Expected answer

JSON
1020
样本分隔符
\n
插入代价
1000
删除代价
100
替换代价
10
Wikipedia example 1

输入

kitten
sitting

Expected answer

JSON
3
样本分隔符
\n
插入代价
1
删除代价
1
替换代价
1

参数

参数默认值输入与选项
样本分隔符"\\n"支持 \n、\r 和 \t 等转义序列
插入代价1数字
删除代价1数字
替换代价1数字

相关工具

实用工具

操作参考

查看原始技术文档 (English)