输入合法即可
文档 git地址 : http://git.sagacloud.cn/chenhaiyang/sim
源码
CREATE OR REPLACE FUNCTION "public"."rel_cilin_str_similar"("word" varchar, "possibilities" _varchar, "num" int4)
RETURNS "pg_catalog"."text" AS $BODY$
from sim.text_sim import most_similar_items
try:
result = most_similar_items(word, possibilities, num)
return result
except Exception as e:
plpy.warning(e)
return ""
else:
plpy.warning(e)
$BODY$
LANGUAGE plpython3u VOLATILE
COST 100
1. word : 需要匹配的字符串
2. possibilities : 被匹配的字符串
3. num : 指定返回匹配到的字符串中相似度最高的num个字符串