module Index: sig
.. end
type 'b
t
Index that maps strings to values of type 'b. Internally it is
based on a trie. A string can only map to one value.
val empty : 'b t
Empty index
val is_empty : 'a t -> bool
val add : 'b t ->
CCLevenshtein.S.string_ -> 'b -> 'b t
Add a pair string/value to the index. If a value was already present
for this string it is replaced.
val cardinal : 'a t -> int
Number of bindings
val remove : 'b t ->
CCLevenshtein.S.string_ -> 'b t
Remove a string (and its associated value, if any) from the index.
val retrieve : limit:int ->
'b t ->
CCLevenshtein.S.string_ -> 'b CCLevenshtein.klist
Lazy list of objects associated to strings close to the query string
val of_list : (CCLevenshtein.S.string_ * 'b) list -> 'b t
Build an index from a list of pairs of strings and values
val to_list : 'b t -> (CCLevenshtein.S.string_ * 'b) list
Extract a list of pairs from an index
val add_seq : 'a t ->
(CCLevenshtein.S.string_ * 'a) CCLevenshtein.sequence ->
'a t
Since 0.14
val of_seq : (CCLevenshtein.S.string_ * 'a) CCLevenshtein.sequence ->
'a t
Since 0.14
val to_seq : 'a t ->
(CCLevenshtein.S.string_ * 'a) CCLevenshtein.sequence
Since 0.14
val add_gen : 'a t ->
(CCLevenshtein.S.string_ * 'a) CCLevenshtein.gen ->
'a t
Since 0.14
val of_gen : (CCLevenshtein.S.string_ * 'a) CCLevenshtein.gen ->
'a t
Since 0.14
val to_gen : 'a t ->
(CCLevenshtein.S.string_ * 'a) CCLevenshtein.gen
Since 0.14
val fold : ('a -> CCLevenshtein.S.string_ -> 'b -> 'a) ->
'a -> 'b t -> 'a
Fold over the stored pairs string/value
val iter : (CCLevenshtein.S.string_ -> 'b -> unit) -> 'b t -> unit
Iterate on the pairs
val to_klist : 'b t ->
(CCLevenshtein.S.string_ * 'b) CCLevenshtein.klist
Conversion to an iterator