Instance Method

distanceBetweenString:andString:distanceType:

Calculates the distance between two strings.

Declaration

- (NLDistance)distanceBetweenString:(NSString *)firstString andString:(NSString *)secondString distanceType:(NLDistanceType)distanceType;

Parameters

firstString

A term in the vector space.

secondString

Another term in the vector space.

distanceType

The type of distance which determines which formula the method uses to calculate distance.

Return Value

An NLDistance (double) value.

See Also

Finding Strings in an Embedding

NLDistance

The distance between two strings in a text embedding.

- neighborsForString:maximumCount:distanceType:

Retrieves the nearest neighbors of a string, given a number of neighbors and a distance type.

- neighborsForString:maximumCount:maximumDistance:distanceType:

Retrieves the nearest neighbors of a string, given a distance, a number of neighbors, and a distance type.

- neighborsForVector:maximumCount:distanceType:

Retrieves the nearest strings to a vector, given a number of neighbors and a distance type.

- neighborsForVector:maximumCount:maximumDistance:distanceType:

Retrieves the nearest strings to a vector, given a distance, a number of neighbors, and a distance type.

- enumerateNeighborsForString:maximumCount:distanceType:usingBlock:

Enumerates the nearest neighbors of a string, given a closure, a number of neighbors, and a distance type.

- enumerateNeighborsForString:maximumCount:maximumDistance:distanceType:usingBlock:

Enumerates the nearest neighbors of a string, given a closure, a distance, a number of neighbors, and a distance type.

- enumerateNeighborsForVector:maximumCount:distanceType:usingBlock:

Enumerates the nearest strings of a vector, given a closure, a number of neighbors, and a distance type.

- enumerateNeighborsForVector:maximumCount:maximumDistance:distanceType:usingBlock:

Enumerates the nearest strings of a vector, given a closure, a distance, a number of neighbors, and a distance type.