fuzzysearch

WebJar for fuzzysearch

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий Search Прикладные библиотеки
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-bevacqua-fuzzysearch
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

fuzzysearch
WebJar for fuzzysearch
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/bevacqua/fuzzysearch

Скачать github-com-bevacqua-fuzzysearch

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-fuzzysearch/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-bevacqua-fuzzysearch</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-fuzzysearch/
implementation 'org.webjars.npm:github-com-bevacqua-fuzzysearch:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-fuzzysearch/
implementation ("org.webjars.npm:github-com-bevacqua-fuzzysearch:1.0.2")
'org.webjars.npm:github-com-bevacqua-fuzzysearch:jar:1.0.2'
<dependency org="org.webjars.npm" name="github-com-bevacqua-fuzzysearch" rev="1.0.2">
  <artifact name="github-com-bevacqua-fuzzysearch" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-bevacqua-fuzzysearch', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "github-com-bevacqua-fuzzysearch" % "1.0.2"
[org.webjars.npm/github-com-bevacqua-fuzzysearch "1.0.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

fuzzysearch

Tiny and blazing-fast fuzzy search in JavaScript

Fuzzy searching allows for flexibly matching a string with partial input, useful for filtering data very quickly based on lightweight user input.

Demo

To see fuzzysearch in action, head over to bevacqua.github.io/horsey, which is a demo of an autocomplete component that uses fuzzysearch to filter out results based on user input.

Install

From npm

npm install --save fuzzysearch

fuzzysearch(needle, haystack)

Returns true if needle matches haystack using a fuzzy-searching algorithm. Note that this program doesn't implement levenshtein distance, but rather a simplified version where there's no approximation. The method will return true only if each character in the needle can be found in the haystack and occurs after the preceding matches.

fuzzysearch('twl', 'cartwheel') // <- true
fuzzysearch('cart', 'cartwheel') // <- true
fuzzysearch('cw', 'cartwheel') // <- true
fuzzysearch('ee', 'cartwheel') // <- true
fuzzysearch('art', 'cartwheel') // <- true
fuzzysearch('eeel', 'cartwheel') // <- false
fuzzysearch('dog', 'cartwheel') // <- false

An exciting application for this kind of algorithm is to filter options from an autocomplete menu, check out horsey for an example on how that might look like.

But! RegExps...!

chart showing abysmal performance for regexp-based implementation

The current implementation uses the algorithm suggested by Mr. Aleph, a crazy russian compiler engineer working at V8.

License

MIT

Версии библиотеки

Версия
1.0.2