GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NeaByteLab/Fuzzy-Net: Fuzzy matching engine that replaces edit-distance calculations with golden-ratio byte hashing and bitwise matrix projection.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.config.ts
build.config.ts
 
 
deno.json
deno.json
 
 
package.json
package.json
 
 

Repository files navigation

Fuzzy-Net Preview

Deno Node Bun Browser

What is Fuzzy-Net?

Fuzzy-Net is a lexical search index that stores each string as a document bit and finds a query by projecting hashed tokens onto those bits, so a misspelled word can still match when enough of its bytes remain.

Installation

Deno:

deno add npm:@neabyte/fuzzy-net

npm:

npm install @neabyte/fuzzy-net

CDN (jsDelivr/esm.sh):

<script type="module">
  import FuzzyNet from 'https://cdn.jsdelivr.net/npm/@neabyte/fuzzy-net/dist/index.mjs'
</script>

Or via esm.sh:

<script type="module">
  import FuzzyNet from 'https://esm.sh/@neabyte/fuzzy-net'
</script>

Usage

import FuzzyNet from '@neabyte/fuzzy-net'

// Build index from five product names
const index = new FuzzyNet([
  'red ceramic coffee mug',
  'blue ceramic tea cup',
  'linen kitchen towel',
  'oak dining chair',
  'wool winter scarf'
])

console.log(index.search('ceramic mug', 2))
// [
//   { value: 'red ceramic coffee mug', score: 16 },
//   { value: 'blue ceramic tea cup', score: 12 }
// ]

console.log(index.search('cermaic', 1))
// [{ value: 'red ceramic coffee mug', score: 8 }]

console.log(index.search('xoffee', 1))
// [{ value: 'red ceramic coffee mug', score: 12 }]

limit defaults to 10, a limit of 0 or below returns [], and a query with no byte features also returns [].

API

new FuzzyNet(values)

Parameter Type Description
values readonly string[] Strings to index. Position in the array is the document id.

The table is built once, and search does not change the indexed strings.

index.search(query, limit?)

Parameter Type Description
query string Query text. A token ends on a byte whose top two bits are 00.
limit number Optional. How many results to return. Default 10.

Returns: FuzzyResult[], highest score first.

type FuzzyIndex = {
  search: (query: string, limit?: number) => FuzzyResult[]
}

type FuzzyResult = {
  value: string
  score: number
}

value is the original indexed string and score is the overlap stage mask, so when two scores are equal the earlier one in the scan stays ahead.

Build

npm run build

Testing

deno task check
deno task test

License

This repository is licensed under Apache 2.0.

About

Fuzzy matching engine that replaces edit-distance calculations with golden-ratio byte hashing and bitwise matrix projection.

www.npmjs.com/package/@neabyte/fuzzy-net

Topics

approximate-string-matchingbit-manipulationbit-matrixbitwise-operationsbloom-filterbyte-tokenizationdocument-rankingfeature-hashingfuzzy-searchin-memory-indexinformation-retrievallexical-searchquery-rankingsearch-enginesearch-indexspell-tolerancestring-matchingtext-indexingtext-searchtypo-tolerance

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.