Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FastSearcher<T, K>

Fast searcher for fuzzy search among a list of strings

Type parameters

  • T

  • K = string

Hierarchy

  • FastSearcher

Index

Constructors

Properties

Methods

Constructors

constructor

  • new FastSearcher(items: readonly T[], toStr?: (a: T) => string, data?: K): FastSearcher
  • Parameters

    • items: readonly T[]
    • Default value toStr: (a: T) => string = x => x as any
        • (a: T): string
        • Parameters

          • a: T

          Returns string

    • Default value data: K = '' as any

    Returns FastSearcher

Properties

data

data: K

Readonly originals

originals: string[] = []

Private Readonly ptr

ptr: number

internal pointer to the FastSearcher instance on WASM heap

Methods

findBestMatch

  • findBestMatch(query: string): readonly [number, number]

sWSearch

  • sWSearch(query: string, numResults: number, gramLen?: number, threshold?: number): SearchResult<K>[]

toJSON

  • toJSON(): string[]

Generated using TypeDoc