SAS 中的 SPEDIS 函数计算成本如下(示例):
例子
data words;
input Operation $ Query $ Keyword $;
Distance = spedis(query,keyword);
Cost = distance * length(query);
datalines;
match fuzzy fuzzy
singlet fuzy fuzzy
doublet fuuzzy fuzzy
swap fzuzy fuzzy
truncate fuzz fuzzy
append fuzzys fuzzy
delete fzzy fuzzy
insert fluzzy fuzzy
replace fizzy fuzzy
firstdel uzzy fuzzy
firstins pfuzzy fuzzy
firstrep wuzzy fuzzy
several floozy fuzzy
;
proc print data = words;
run;
我正在寻找做同样事情的 R 函数。需要帮忙。