UNPKG

fuzzy-rater

Version:

Tooling for fuzzily rating text according to some query

31 lines 1.72 kB
import { INormalizedNFATemplate } from "../../NFA/_types/INormalizedNFATemplate"; import { INormalizedNFATransition } from "../../NFA/_types/INormalizedNFATransition"; import { IExtendedFuzzyNodeData } from "./_types/IFuzzyNodeData"; import { IFuzzyTransitionData } from "./_types/IFuzzyTransitionData"; /** * Creates a new dfa template based on the query and max distance * @param query The query to create a template for * @param maxDistance The maximal allowed distance * @param exitOnMatch Whether the NFA should exit out of the node after match * @returns A dfa template */ export declare function createFuzzyNFATemplate(query: string, maxDistance: number, exitOnMatch?: boolean): INormalizedNFATemplate<IExtendedFuzzyNodeData, IFuzzyTransitionData>; /** * Retrieves all the transitions for a given node * @param query The query the transitions are for * @param maxDist The maximal allowed distance * @param dist The current distance * @param index The index of character matched so far * @param exitOnMatch Whether the NFA should exit out of the node after match * @returns The set of transitions from this node */ export declare function getTransitions(query: string, maxDist: number, dist: number, index: number, exitOnMatch?: boolean): INormalizedNFATransition<IFuzzyTransitionData>[]; /** * Retrieves the ID for a node with the given data * @param query The query the node is for * @param dist The correctness distance the node is for * @param index The character index matched by the node * @returns THe ID for the node */ export declare function getID(query: string, dist: number, index: number): string; //# sourceMappingURL=createFuzzyNFATemplate.d.ts.map