adamstirtan / LevenshteinDistance

Fuzzy string matching using the Levenshtein distance algorithm in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Levenshtein Distance in C#

In information theory, linguistics, and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. It is named after the Soviet mathematician Vladimir Levenshtein, who considered this distance in 1965.

Levenshtein distance may also be referred to as edit distance, although that term may also denote a larger family of distance metrics known collectively as edit distance.

Getting Started

This repository consists of a Visual Studio solution with three projects:

  1. LevenshteinDistance.Core: The main with the algorithm implementation/class
  2. LevenshteinDistance.Blazor: A Blaazor app with a demo autocomplete list of countries
  3. LevenshteinDistance.Tests: MSTest project with a few basic tests to run and debug to understand how it works

Prerequisites

  • Visual Studio, Visual Studio Code, etc
  • .NET 6

Use cases

  • Spell checking
  • Speech recognition
  • DNA analysis
  • Plagiarism detection

Algorithm

image

Running the tests

dotnet test

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

About

Fuzzy string matching using the Levenshtein distance algorithm in C#

License:MIT License


Languages

Language:HTML 44.8%Language:CSS 32.0%Language:C# 23.2%