setsim

package module
v0.0.0-...-ce9ec6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

README

Setsim is a library to calculate the Similarity of two ordered Lists.

Installation go get github.com/the42/setsim
Build status Build Status
Documentation GoDoc

Copyright (c) 2016 Johann Höchtl. For License see LICENSE

This libray uses a combination of

The items of the lists have to be bytes and, for comparability as a string, interpretable as UTF8-Runes.

For further reading see http://theory.stanford.edu/~sergei/slides/www10-metrics.pdf

Documentation

Overview

Package setsim provides fuctionality to calculate the distance between two ordered lists. The items within the list are interpreted as bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(a, b [][]byte) int

Distance is a measure for the structural difference of two byte lists, which can be interpreted as strings. It first calculates the difference between two set items using Levenshtein distance. This distance measures serves as a weight to multiply with Spearman Foot Distance.

See also the documentation on SpearmanFootDistance concerning the normalization of strings.

For more information see http://theory.stanford.edu/~sergei/slides/www10-metrics.pdf

func SpearmanFootDistance

func SpearmanFootDistance(a, b [][]byte) int

SpearmanFootDistance calculates the Spearman Footrule Distance of two byte arrays For more information see https://mikespivey.wordpress.com/2014/01/20/the-maximum-value-of-spearmans-footrule-distance/ When comparing two strings, you might consider normalizing these strings eg. http://unicode.org/faq/normalization.html This function extends the classical definition of Spearman Footrule Distance in the sense that if one element of set a or set b is not contained within the other set, max(len a , len b ) is added to the Foot Distance.

func StringDistance

func StringDistance(a, b []string) int

StringDistance is a helper function to Distance which accepts an array of strings. See the documentation on SpearmanFootDistance concerning the normalization of strings.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL