je.suis/un-petit-index

A simple, inefficient multi-language text search index.

GitHub | Clojars
je.suis/un-petit-index {:mvn/version "0.2.0-SNAPSHOT"}

Usage

(require [je.suis.un-petit-index :as pi])

(def gramdb
  (pi/map-to-gramdb
   {:foo "I am a foo, nothing more, nothing less."
    :bar "At a bar, one has nothing more to do but pity a foo."}))
(def index (pi/gramdb-to-index gramdb))

(pi/normalized-gramdb-query gramdb "foo")
;; => {:foo 1, :bar 1}

(pi/normalized-index-query index "bar")
;; => {:bar 1, :foo 1/3}