Product Design, Manufacturing & Innovation Resources
Lar » Ferramentas online » Algoritmos de comparação de cadeias de caracteres (ou similaridades de cadeias de caracteres)

Algoritmos de comparação de cadeias de caracteres (ou similaridades de cadeias de caracteres)

Em programação, sempre que você quiser ser mais inteligente do que simplesmente comparar se duas strings são perfeitamente iguais ('abc' == 'abd'?), como por exemplo, o quanto a primeira string difere da segunda (como no caso de um erro de digitação do usuário), você tem à disposição diversos algoritmos, cada um com seus prós e contras, ou criados para casos especiais.

Bem, este site serve exatamente para isso: forneça duas strings de exemplo e ele aplicará vários algoritmos, mostrando as diferenças. Dependendo das strings que você deseja identificar, em alguns testes, você saberá qual o melhor algoritmo e limite a serem aplicados no seu caso. Ele testa todos os algoritmos de uma só vez e retorna uma porcentagem de similaridade entre as strings.

  • Levenshtein
  • NeedlemanWunch
  • Smith-Waterman
  • Smith-Waterman Gotoh
  • Smith-Waterman Gotoh Janelado Affine
  • Jaro
  • Jaro Winkler
  • Distância QGrams
  • Distância do quarteirão
  • Semelhança de cosseno
  • Distância euclidiana
  • Desvio de Comprimento de Chapman
  • Coeficiente de sobreposição

(Algumas integradas diretamente na sua linguagem favorita, outras necessitando de bibliotecas externas ou codificadas por você)

Observação: o site está protegido por um bloqueador de bots, semelhante ao Cloudflare, o que é irritante, mas nada de muito especial (exceto pela captura de tela desagradável para nós).

Disciplinas: Ciência da Computação, Ciência de Dados, Bioinformática, Linguística, Engenharia de Software.
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.

Tópicos abordados: Comparação de strings, similaridades entre strings, Levenshtein, Needleman-Wunsch, Smith-Waterman, Jaro, Jaro-Winkler, distância Q-Grams, distância entre blocos, similaridade de cosseno, distância euclidiana, desvio de comprimento de Chapman, coeficiente de sobreposição, algoritmo, limiar, porcentagem de similaridade, detecção de erros de digitação, ISO/IEC 30170, ISO/IEC 24765, ISO/IEC 25010, ISO/IEC 25012 e ISO/IEC 25051.

Mais Codificação, Texto relacionado ferramentas

Sugira a melhor ferramenta online:

Você conhece um site melhor, complementar ou substituto para o listado acima?

> Sugira aqui <

10º ano aniversário

Imagens em tamanho real e downloads estão disponíveis apenas, 100% gratuitos, para membros registrados.