数据结构检索字符串就在附近Levenshtein距离 [英] Data structure for retrieving strings that are close by Levenshtein distance

查看:182
本文介绍了数据结构检索字符串就在附近Levenshtein距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,从一组英文单词,有一个结构/算法,允许诸如淡味和从紧字符串中的一个快速检索,用的是正确的查询?也就是说,我要找回小Levenshtein距离字符串查询字符串。

For example, starting with the set of english words, is there a structure/algorithm that allows one fast retrieval of strings such as "light" and "tight", using the word "right" as the query? I.e., I want to retrieve strings with small Levenshtein distance to the query string.

推荐答案

的的 BK树的数据结构可能在这里是合适的。它的设计,有效地支持表单查询什么都在编辑距离K以下的所有的话,从一个查询词?它的性能保证是相当不错的,而且这不是太难以实现。

The BK-tree data structure might be appropriate here. It's designed to efficiently support queries of the form "what are all words within edit distance k or less from a query word?" Its performance guarantees are reasonably good, and it's not too difficult to implement.

希望这有助于!

这篇关于数据结构检索字符串就在附近Levenshtein距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆