Loading documentation...
Loading documentation...
Loading documentation...
Complete API documentation for the algorithms package.
Import Path: github.com/kolosys/synapse/algorithms
DamerauLevenshtein computes the Damerau-Levenshtein distance Similar to Levenshtein but also allows transpositions
func DamerauLevenshtein(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of DamerauLevenshtein
result := DamerauLevenshtein(/* parameters */)Euclidean computes the Euclidean distance between two points Returns a similarity score (inverse of distance)
func Euclidean(a, b []float64) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []float64 | |
b | []float64 |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Euclidean
result := Euclidean(/* parameters */)Hamming computes the Hamming distance between two strings Strings must be of equal length. Returns a normalized score between 0.0 and 1.0
func Hamming(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Hamming
result := Hamming(/* parameters */)HammingBytes computes the Hamming distance between two byte slices
func HammingBytes(a, b []byte) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []byte | |
b | []byte |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of HammingBytes
result := HammingBytes(/* parameters */)Levenshtein computes the Levenshtein distance between two strings Returns a normalized score between 0.0 (completely different) and 1.0 (identical)
func Levenshtein(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Levenshtein
result := Levenshtein(/* parameters */)Manhattan computes the Manhattan distance between two points
func Manhattan(a, b []float64) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []float64 | |
b | []float64 |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Manhattan
result := Manhattan(/* parameters */)Complete API documentation for the algorithms package.
Import Path: github.com/kolosys/synapse/algorithms
DamerauLevenshtein computes the Damerau-Levenshtein distance Similar to Levenshtein but also allows transpositions
func DamerauLevenshtein(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of DamerauLevenshtein
result := DamerauLevenshtein(/* parameters */)Euclidean computes the Euclidean distance between two points Returns a similarity score (inverse of distance)
func Euclidean(a, b []float64) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []float64 | |
b | []float64 |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Euclidean
result := Euclidean(/* parameters */)Hamming computes the Hamming distance between two strings Strings must be of equal length. Returns a normalized score between 0.0 and 1.0
func Hamming(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Hamming
result := Hamming(/* parameters */)HammingBytes computes the Hamming distance between two byte slices
func HammingBytes(a, b []byte) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []byte | |
b | []byte |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of HammingBytes
result := HammingBytes(/* parameters */)Levenshtein computes the Levenshtein distance between two strings Returns a normalized score between 0.0 (completely different) and 1.0 (identical)
func Levenshtein(a, b string) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | string | |
b | string |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Levenshtein
result := Levenshtein(/* parameters */)Manhattan computes the Manhattan distance between two points
func Manhattan(a, b []float64) float64Parameters:
| Parameter | Type | Description |
|---|---|---|
a | []float64 | |
b | []float64 |
Returns:
| Type | Description |
|---|---|
float64 |
Example:
// Example usage of Manhattan
result := Manhattan(/* parameters */)func DamerauLevenshtein(a, b string) float64// Example usage of DamerauLevenshtein
result := DamerauLevenshtein(/* parameters */)func Euclidean(a, b []float64) float64// Example usage of Euclidean
result := Euclidean(/* parameters */)func Hamming(a, b string) float64// Example usage of Hamming
result := Hamming(/* parameters */)func HammingBytes(a, b []byte) float64// Example usage of HammingBytes
result := HammingBytes(/* parameters */)func Levenshtein(a, b string) float64// Example usage of Levenshtein
result := Levenshtein(/* parameters */)func Manhattan(a, b []float64) float64// Example usage of Manhattan
result := Manhattan(/* parameters */)func DamerauLevenshtein(a, b string) float64// Example usage of DamerauLevenshtein
result := DamerauLevenshtein(/* parameters */)func Euclidean(a, b []float64) float64// Example usage of Euclidean
result := Euclidean(/* parameters */)func Hamming(a, b string) float64// Example usage of Hamming
result := Hamming(/* parameters */)func HammingBytes(a, b []byte) float64// Example usage of HammingBytes
result := HammingBytes(/* parameters */)func Levenshtein(a, b string) float64// Example usage of Levenshtein
result := Levenshtein(/* parameters */)func Manhattan(a, b []float64) float64// Example usage of Manhattan
result := Manhattan(/* parameters */)