@nura-js/plugin-fuzzy
v0.1.1
Published
Lightweight fuzzy matching utilities for Nura.js
Readme
@nura-js/plugin-fuzzy
Fuzzy, phonetic, and token-based matching utilities shared by Nura.js and its voice tooling.
Installation
pnpm add @nura-js/plugin-fuzzyUsage Example
import { matchFuzzy, tokenizeAndScore, compareWakeWord } from '@nura-js/plugin-fuzzy';
const brands = ['Nura', 'Núria', 'Nero'];
const match = matchFuzzy('nura', brands, { locale: 'es' });
const tokens = tokenizeAndScore('abre el modo noche', ['modo noche', 'modo día']);
const wake = compareWakeWord('hey nura', {
canonical: 'hey nura',
aliases: ['hola nura'],
});Key APIs
matchFuzzyscores candidates using the selected strategy and locale heuristics.tokenizeAndScoreevaluates each token against candidate phrases.compareWakeWordchecks wake-word candidates for hybrid phonetic similarity.damerauLevenshteinSimilarityexposes the raw edit-distance helper.
Type References
FuzzyMatchOpts— strategy, locale, and threshold options.MatchResult— output frommatchFuzzyincluding the winning candidate.TokenScore— granular token scoring result used bytokenizeAndScore.FuzzyStrategy— supported strategies ('hybrid','damerau', ...).
Additional Resources
- Repository: https://github.com/nura-ia/nurajs
- Issues: https://github.com/nura-ia/nurajs/issues
