N-Gram距離 = |GN(s)|+|GN(t)|−2×|GN(s)∩GN(t)|
|GN(s)| 是字符串 s 的 N-Gram集合,N 值一般取2或者3,假設N=2爲例對字符串Gorbachev和Gorbechyov進行分段:
距離:8 + 9 − 2 × 4 = 9
N-Gram距離 = |GN(s)|+|GN(t)|−2×|GN(s)∩GN(t)|
|GN(s)| 是字符串 s 的 N-Gram集合,N 值一般取2或者3,假設N=2爲例對字符串Gorbachev和Gorbechyov進行分段:
距離:8 + 9 − 2 × 4 = 9