莱文斯坦距離

計算把一个字串改成另一个所需的最少插入、刪除和替換次數。

輸入: 文本結果: 數值

文本輸入

工具選項

範例

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)