Product Design, Manufacturing & Innovation Resources
家 » 在线工具 » 字符串比较算法(或字符串相似度)

字符串比较算法(或字符串相似度)

在编码过程中,如果您想比比较两个字符串是否完全相等("abc" == "abd" ?)更聪明......比如第一个字符串与第二个字符串的差别有多大(比如用户输入的内容有错别字),您可以在几种算法中进行选择,每种算法都有优缺点或针对特殊情况。

这个网站正是为此而设:提供两个字符串样本,它会应用多种算法并告诉你它们之间的差异。根据你要识别的字符串,经过几次测试,你就能知道最适合你情况的算法和阈值。它会一次性测试所有这些算法,并返回字符串相似度百分比:

  • 莱文斯坦
  • 针线人温奇
  • 史密斯-沃特曼
  • 史密斯-沃特曼·戈托
  • Smith-Waterman Gotoh 窗口仿射
  • 年
  • 温克勒
  • QGrams距离
  • 街区距离
  • 余弦相似度
  • 欧氏距离
  • 查普曼长度偏差
  • 重叠系数

(有些可以直接集成到你喜欢的语言中,有些需要外部库或由你自行编写代码)

注意:该网站设有类似 Cloudflare 的机器人拦截墙,很烦人,但也没什么特别的(除了我们看到的难看截图)。

学科: 计算机科学、数据科学、生物信息学、语言学、软件工程。
Free alternative to Diffchecker, Beyond Compare, Python difflib.
Strings Comparison Algorithms compared with Diffchecker, Beyond Compare and Python difflib
Strings Comparison AlgorithmsDiffcheckerBeyond ComparePython difflib
What it measures: The page takes two sample strings and runs 13 algorithms at once, returning a similarity percentage for each. You can then pick the algorithm and the threshold that fit your data.What it measures: The vendor describes core side-by-side comparison of two texts or files, plus Redline and folder or batch comparison on paid plans. The pricing page does not mention selectable similarity metrics.What it measures: The vendor describes comparison of folders, text files, images and tables, with syntax highlighting and comparison rules for documents and source code.What it measures: SequenceMatcher.ratio() returns a float between 0 and 1 computed as 2.0*M/T, where M is the number of matches and T the total number of elements in both sequences.
Algorithm basis: The list includes Levenshtein, Needleman-Wunsch, Smith-Waterman (with Gotoh variants), Jaro, Jaro-Winkler, q-grams, block distance, cosine similarity, Euclidean distance, Chapman length deviation and overlap coefficient. Edit-distance and alignment methods sit side by side.Algorithm basis: The matching method is described as a little fancier than the Ratcliff-Obershelp gestalt algorithm. The documentation does not mention Levenshtein distance.
Use in code: Some of the listed algorithms ship with common languages, while others need external libraries or your own implementation.Use in code: Separate API plans allow the comparison engine to be embedded in other applications.Use in code: A scripting language is offered to automate syncs.Use in code: It belongs to the Python standard library. get_close_matches(word, possibilities, n=3, cutoff=0.6) returns the best candidates. Worst-case time is quadratic, and strings of 200 or more items trigger an automatic junk heuristic that can be disabled with autojunk=False.
Licence, cost and platform: The page runs in the browser and sits behind a bot-blocking wall. A price or licence is not stated in the material available.Licence, cost and platform: The Basic plan is free with no file size limit, but many Pro features are capped at about 5 to 10 uses monthly. Pro with desktop app is a paid per-seat plan, and the desktop app runs on Windows, Mac and Linux.Licence, cost and platform: A per-user licence in Standard and Pro editions is a one-time purchase with no annual renewal fees. It runs on Windows, macOS and Linux and can be evaluated for free.Licence, cost and platform: No separate cost, since it ships with Python. The documentation is under the Python Software Foundation License Version 2.

涵盖的主题: 字符串比较、字符串相似性、Levenshtein、Needleman-Wunsch、Smith-Waterman、Jaro、Jaro-Winkler、Q-Grams Distance、Block Distance、Cosine Similarity、Euclidean Distance、Chapman Length Deviation、Overlap Coefficient、Algorithm、Threshold、Similarity Percentage、Typo DetectionISO/IEC 30170、ISO/IEC 24765、ISO/IEC 25010、ISO/IEC 25012 和 ISO/IEC 25051。.

更多的 编码, 文本相关 工具

请推荐您最喜欢的在线工具:

您是否知道有比上面列出的网站更好、更互补或可以替代的网站?

> 在此处提出建议 <

第十年 周年纪念日

只有注册会员才能免费获得 100% 的全尺寸图片和下载。.

> 登录 <