(->index some-set)
Inputs: [some-set :- (s/cond-pre tsk/Set tsk/Vec)] Returns: SortedSetType
Converts a sequence (vec or set) into a lexically-sorted index
Inputs: [some-set :- (s/cond-pre tsk/Set tsk/Vec)] Returns: SortedSetType Converts a sequence (vec or set) into a lexically-sorted index
(add-entry index entry)
Inputs: [index :- SortedSetType entry :- tsk/Vec]
Add an entry to the index, returning the modified index
Inputs: [index :- SortedSetType entry :- tsk/Vec] Add an entry to the index, returning the modified index
(bound-lower val)
Inputs: [val :- tsk/Vec] Returns: tsk/Vec
Given a lexical value as a vector such as [1 :a], returns a lower bound like [1]
Inputs: [val :- tsk/Vec] Returns: tsk/Vec Given a lexical value as a vector such as [1 :a], returns a lower bound like [1]
(empty-index)
Inputs: []
Returns an empty lexically-sorted index
Inputs: [] Returns an empty lexically-sorted index
(prefix-match? pattern sample)
Inputs: [pattern :- LexicalValType sample :- LexicalValType] Returns: s/Bool
Returns true if the sample value equals the pattern when truncated to the same length
Inputs: [pattern :- LexicalValType sample :- LexicalValType] Returns: s/Bool Returns true if the sample value equals the pattern when truncated to the same length
(prefix-matches match-val lex-set)
Inputs: [match-val :- LexicalValType lex-set :- SortedSetType] Returns: SortedSetType
Return the :matches
values found via split-key-prefix
.
Inputs: [match-val :- LexicalValType lex-set :- SortedSetType] Returns: SortedSetType Return the `:matches` values found via `split-key-prefix`.
(remove-entry index entry)
Inputs: [index :- SortedSetType entry :- tsk/Vec]
Remove an entry to the index, returning the modified index. Throws if entry not found in index.
Inputs: [index :- SortedSetType entry :- tsk/Vec] Remove an entry to the index, returning the modified index. Throws if entry not found in index.
(split-key-prefix match-val lex-set)
Inputs: [match-val :- LexicalValType lex-set :- SortedSetType] Returns: #:s{Keyword SortedSetType}
Like clojure.data.avl/split-key, but allows prefix matches. Given a lexically sorted set like: #{[:a 1] [:a 2] [:a 3] [:b 1] [:b 2] [:b 3] [:c 1] [:c 2]} splits data by prefix match for patterns like [:b], returning a map of 3 sorted sets like: {:smaller #{[:a 1] [:a 2] [:a 3]} :matches #{[:b 1] [:b 2] [:b 3]} :larger #{[:c 1] [:c 2]} ]
Inputs: [match-val :- LexicalValType lex-set :- SortedSetType] Returns: #:s{Keyword SortedSetType} Like clojure.data.avl/split-key, but allows prefix matches. Given a lexically sorted set like: #{[:a 1] [:a 2] [:a 3] [:b 1] [:b 2] [:b 3] [:c 1] [:c 2]} splits data by prefix match for patterns like [:b], returning a map of 3 sorted sets like: {:smaller #{[:a 1] [:a 2] [:a 3]} :matches #{[:b 1] [:b 2] [:b 3]} :larger #{[:c 1] [:c 2]} ]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close