@ychebotaev/trigrams

0.1.0 • Public • Published

trigrams

A data structure to store words by it's trigrams

Usage

import { Trigrams } from '@ychebotaev/trigrams'

const t = new Trigrams()

t.add('hello')
t.add('world')

t.has('hello') // => true
t.has('world') // => true

t.delete('world')

t.has('world') // => false

t.keys() // => ['hel', 'ell', 'llo']
t.values() // => ['hello']

t.find('ell') // => ['hello']

Contribution

Built with vite and vitest

Run tests

npm test

Readme

Keywords

Package Sidebar

Install

npm i @ychebotaev/trigrams

Weekly Downloads

1

Version

0.1.0

License

ISC

Unpacked Size

3.05 kB

Total Files

3

Last publish

Collaborators

  • ychebotaev