Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FuzzyMatcher<Target, Extraction>

A fuzzy matcher. The fuzziness it determined by the provided distance function.

export
interface

FuzzyMatcher

Type parameters

  • Target

    The type of the returned matched object.

  • Extraction

    The type of the query object.

Hierarchy

  • FuzzyMatcher

Index

Methods

empty

  • empty(): boolean
  • memberof

    FuzzyMatcher

    Returns boolean

    true iff size === 0

kNearest

  • kNearest(target: Extraction, k: number): Match<Target>[]
  • Find the k nearest elements.

    memberof

    FuzzyMatcher

    Parameters

    • target: Extraction

      The search target.

    • k: number

      The maximum number of result to return.

    Returns Match<Target>[]

    The k nearest matches to target.

kNearestWithin

  • kNearestWithin(target: Extraction, k: number, threshold: number): Match<Target>[]
  • Find the k nearest elements.

    memberof

    FuzzyMatcher

    Parameters

    • target: Extraction

      The search target.

    • k: number

      The maximum number of result to return.

    • threshold: number

      The maximum distance to a match.

    Returns Match<Target>[]

    The k nearest matches to target within threshold.

nearest

  • nearest(target: Extraction): undefined | Match<Target>
  • Find the nearest element.

    memberof

    FuzzyMatcher

    Parameters

    • target: Extraction

      The search target.

    Returns undefined | Match<Target>

    The closest match to target, or undefined if the initial targets list was empty.

nearestWithin

  • nearestWithin(target: Extraction, threshold: number): undefined | Match<Target>
  • Find the nearest element.

    memberof

    FuzzyMatcher

    Parameters

    • target: Extraction

      The search target.

    • threshold: number

      The maximum distance to a match.

    Returns undefined | Match<Target>

    The closest match to target within threshold, or undefined if no match is found.

size

  • size(): number
  • memberof

    FuzzyMatcher

    Returns number

    The number of targets constructed with.

Generated using TypeDoc