Skip to content

Repeating bigrams handled incorrectly #8

Open
@stagha

Description

@stagha

This can be demonstrated by the below code snippet:

var testString = "aaaaaaaaa";

var diceCoefficient = testString.DiceCoefficient(testString);

Assert.Equal(1, diceCoefficient);

The test fails. The reason is Intersect returns the distinct overlapping bigrams. But you then divide by the number of bigrams in the two strings including duplicates, which is incorrect.

https://github.com/tylerjensen/FuzzyStrings/blob/master/src/DuoVia.FuzzyStrings/DuoVia.FuzzyStrings/DiceCoefficientExtensions.cs#L36

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions