Skip to content

Calculate percentage similar #7

@vbisbest

Description

@vbisbest

How can I take the distance and compute a percentage of similarity? For instance, if given this example

	a := []byte("this is a test for results")
	aHash := simhash.Simhash(simhash.NewWordFeatureSet(a))

	b := []byte("this is a test for cats")
	bHash := simhash.Simhash(simhash.NewWordFeatureSet(b))

	c := simhash.Compare(aHash, bHash)
	fmt.Println(c)

I get an output of 7. But I would like to see that these are 90% similar (or whatever the exact amount is). Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions