fuzzbunny เป็นขนาดเล็ก (1k), Fast & Memory Efficient Fuzzy String Searching/Matching/Hellighting Library มันทำงานได้ดีพอ ๆ กันในสภาพแวดล้อมของเบราว์เซอร์หรือ Node.js
ห้องสมุดที่คล้ายกันอื่น ๆ ได้แก่ ฟัซซัตช์, ฟัซซี่, ฟัซซี่-ค้นหา, ฟัซซี่
fuzzbunny ตั้งเป้าหมายที่จะว่องไวและรวดเร็ว มันมี API ง่าย ๆ ที่สามารถรวมเข้ากับไลบรารีส่วนหน้าเพื่อสร้าง UI การค้นหาที่ยอดเยี่ยม เราใช้มันที่ Mixpanel.com เพื่อเพิ่มพลังงานแบบเลื่อนลงและตาราง UI ของเรา
npm install --save fuzzbunny หรือ yarn add fuzzbunny
การสาธิตแคตตาล็อก Fuzzbunny Gutenberg →

const { fuzzyFilter , fuzzyMatch } = require ( `fuzzbunny` ) ;
// or import {fuzzyFilter, fuzzyMatch} from 'fuzzbunny';
const heroes = [
{
name : `Claire Bennet` ,
ability : `Rapid cellular regeneration` ,
} ,
{
name : `Micah Sanders` ,
ability : `Technopathy` ,
} ,
{
name : `Hiro Nakamura` ,
ability : `Space-time manipulation` ,
} ,
{
name : `Peter Petrelli` ,
ability : `Tactile power mimicry` ,
} ,
] ;
// Use fuzzyFilter to filter an array of items on specific fields and get filtered + score-sorted results with highlights.
const results = fuzzyFilter ( heroes , `stm` , { fields : [ `name` , `ability` ] } ) ;
/*
results = [
{
item: {
name: 'Peter Petrelli',
ability: 'Tactile power mimicry',
},
score: 1786,
highlights: {
ability: ['', 'T', 'actile power ', 'm', 'imicry'],
},
},
{
item: {
name: 'Hiro Nakamura',
ability: 'Space-time manipulation',
},
score: 983,
highlights: {
ability: ['Space-', 't', 'ime ', 'm', 'anipulation'],
},
},
];
*/
// Use fuzzyMatch to match a single string to get score + highlights. Returns null if no match found.
const match = fuzzyMatch ( heroes [ 0 ] . name , `ben` ) ;
/*
match = {
score: 2893,
highlights: ['Claire ', 'Ben', 'net'],
};
*/ fuzzbunny ใช้อัลกอริทึมการให้คะแนนที่จัดลำดับความสำคัญของสัญญาณต่อไปนี้ ดูฟังก์ชัน _getMatchScore
ตัวอย่างที่ 1:
{Mayfl}ower อยู่เหนือ The {Mayfl}owerThe {Mayfl}ower อยู่ใน Story of the {Mayfl}owerThe {Mayfl}ower อยู่ด้านบน {May} {fl}owerThe {May} {fl}ower อยู่เหนือ This {May} {fl}ower 
ตัวอย่างที่ 2:
const f = require ( `fuzzbunny` ) ;
f . fuzzyMatch ( `Gobbling pupusas` , `usa` ) ;
// {score: 2700, highlights: ['Gobbling pup', 'usa', 's']}
f . fuzzyMatch ( `United Sheets of Antarctica` , `usa` ) ;
// {score: 2276, highlights: ['', 'U', 'nited ', 'S', 'heets of ', 'A', 'ntarctica']} Gobbling pup{usa}s ชนะเนื่องจากตัวอักษร 3 ตัวต่อเนื่องกันได้คะแนนสูงกว่า
หมายเหตุ : fuzzbunny optmizes สำหรับผลลัพธ์ที่มีความหมาย มันมีเพียงการจับคู่ substring/คำนำหน้า/คำย่อไม่ใช่การจับคู่โลภ
นี่เป็นเพราะสมองของมนุษย์นั้นยอดเยี่ยมในการเรียกคืนคำนำหน้า เช่นคำที่เริ่มต้นด้วย "CA" นั้นง่ายกว่าที่จะจำได้มากกว่าคำที่มีตัวอักษร "C" และ "A" ที่ไหนสักแห่ง เป็นเรื่องง่ายที่จะจำไว้ว่า {usa} หมายถึง {U}nited {S}tates of {A}merica ไม่ใช่ F{u}ll Java{s}cript Fr{a}mework
fuzzbunny ตรงกับ ~ ล้านบรรทัด/วินาทีในฮาร์ดแวร์ที่ทันสมัย ทดสอบเมื่อปี 2018 MacBook Pro ด้วย CPU 2.4GHz ดูการทดสอบ/performance.js
fuzzbunny มาพร้อมกับประเภท typeogenerated typeogenated ดู index.d.ts