Contents

enumerateNeighborsForString:maximumCount:maximumDistance:distanceType:usingBlock:

Passes the nearest strings, within a radius of a string in the vocabulary, to a block.

Declaration

- (void) enumerateNeighborsForString:(NSString *) string maximumCount:(NSUInteger) maxCount maximumDistance:(NLDistance) maxDistance distanceType:(NLDistanceType) distanceType usingBlock:(void (^)(NSString *neighbor, NLDistance distance, BOOL *stop)) block;

Parameters

  • string:

    A string in the embedding vocabulary.

  • maxCount:

    The largest number of times the method calls block.

  • distanceType:

    A means of calculating distance that determines which formula the method uses to evaluate a neighbor’s distance from string.

  • block:

    A block with the following parameters:

    neighbor

    A neighboring string.

    distance

    The distance from string to the neighboring string.

    stop

    A Boolean that indicates whether to stop enumerating neighbors.

See Also

Finding strings and their distances in an embedding