Skip to content

Latest commit

 

History

History
31 lines (18 loc) · 648 Bytes

README.md

File metadata and controls

31 lines (18 loc) · 648 Bytes

clj-trie

A Clojure library designed to for prefix-matching strings, but will work with other sequences too.

Build status

Usage

(require '[clj-trie.core :as tr])

(def my-trie (atom (tr/trie ["apple" "apples" "banana"])))

(tr/prefix-matches @my-trie "ap")
; => ("apple" "apples")

(tr/prefix-matches @my-trie "ba")
; => ("banana")

(swap! my-trie tr/insert-value "bananas")

(tr/prefix-matches @my-trie "ba")
; => ("banana" "bananas")

License

Copyright © 2015 github.com/chetbox

Licensed under the Apache License, Version 2.0.