Skip to content

Commit

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

**Implementation of the Jaccard Similarity algorithm for calculating the similarity between two strings.**

## JaccardSimilarity Class Members

```csharp
CalculateJaccardSimilarity(
string text1,
string text2)
```

Calculates the Jaccard similarity between two strings.

## Parameters

- `text1` (Type: `string`): The first string to compare.
- `text2` (Type: `string`): The second string to compare.

## Returns

- Type: `double`
- Description: A double value representing the similarity between the two strings, ranging from 0.00 to 1.00.

## Example

```csharp
using NetPlus.Algorithms.Comparison;

// Example strings
string text1 = "Hello World";
string text2 = "Hello";

// Calculating Jaccard Similarity
double similarity = text1.CalculateJaccardSimilarity(text2);

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

## Usage

To use the `JaccardSimilarity` class, simply call the `CalculateJaccardSimilarity` method with the appropriate parameters.

```csharp
// Example usage
double similarity = text1.CalculateJaccardSimilarity(text2);
```

## Remarks

The `JaccardSimilarity` class uses the Jaccard Similarity algorithm to calculate the similarity between two strings. It returns a double value representing the similarity between the two strings, ranging from 0.00 to 1.00.

```csharp
// Example of different strings
string text1 = "Hello World";
string text2 = "Goodbye";

// Calculating Jaccard Similarity
double similarity = text1.CalculateJaccardSimilarity(text2);

// Displaying the similarity
Console.WriteLine(similarity); // Outputs: 0.0
```

In the above example, the strings are different, so the method returns 0.0.

0 comments on commit ba17de5

Please sign in to comment.