Skip to content

Commit

Permalink
Create levenshteinsimilarity.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gsilvamartin authored Feb 24, 2024
1 parent 9ee57e1 commit cb4aea5
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/docs/algorithms/comparison/levenshteinsimilarity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# LevenshteinSimilarity Class

**Static class providing extension methods for calculating the Levenshtein similarity between two strings.**

## Class Members

```csharp
CalculateLevenshteinSimilarity(
string source,
string target)
```

Calculates the Levenshtein similarity between two strings.

### Parameters

- `source` (Type: `string`): The source string for comparison.
- `target` (Type: `string`): The target string for comparison.

### Returns

- Type: `int`
- Description: An integer representing the Levenshtein similarity between the two strings.

### Example

```csharp
using NetPlus.Algorithms.Comparison;

// Example strings
string source = "Hello World";
string target = "Hello";

// Calculating Levenshtein similarity
int similarity = source.CalculateLevenshteinSimilarity(target);

// Displaying similarity
Console.WriteLine(similarity);
```

### Usage

To use the `LevenshteinSimilarity` class, simply call the `CalculateLevenshteinSimilarity` method with the appropriate parameters.

```csharp
// Example usage
int similarity = source.CalculateLevenshteinSimilarity(target);
```

### Remarks

The `LevenshteinSimilarity` class uses the Levenshtein algorithm to calculate the similarity between two strings. It returns an integer value representing the similarity between the two strings.

0 comments on commit cb4aea5

Please sign in to comment.