mvc-works / fuzzy-filter

Customized text filter solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fuzzy Filter

filter function for better intuitions.

Demo http://r.tiye.me/mvc-works/fuzzy-filter/

Usage

ns your-app
  :require
    fuzzy-filter.core :refer $ parse-by-letter parse-by-word
    fuzzy-filter.comp.visual :refer $ comp-visual
parse-by-letter "this and that to search" "that search"

; => {:matches? false, :chunks [[:hit "th"] [:rest "is "] [:hit "a"] [:rest "nd "] [:hit "t"] [:space "h"] [:rest "at to "] [:hit "searc"] [:rest "h"] [:missed "g"]], :text "this and that to search"}

parse-by-word "|this and that to search" "|that searcH"
; => {:matches? false, :chunks [[:rest "this and "] [:hit "that"] [:missed "searcH"]], :text "this and that to search"}

comp-visual (:sequences result) {}
  :style-rest $ {}
    :color (hsl 0 0 70)
:style-base
:style-hit
:style-rest

Workflow

Workflow https://github.com/calcit-lang/respo-calcit-workflow

License

MIT

About

Customized text filter solution


Languages

Language:Cirru 90.5%Language:CSS 4.1%Language:HTML 4.0%Language:JavaScript 1.4%