package spelll

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Make.IndexSource

Sourcetype '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.

Sourceval empty : 'b t

Empty index

Sourceval is_empty : _ t -> bool
Sourceval add : 'b t -> string_ -> 'b -> 'b t

Add a pair string/value to the index. If a value was already present for this string it is replaced.

Sourceval remove : 'b t -> string_ -> 'b t

Remove a string (and its associated value, if any) from the index.

Sourceval retrieve : limit:int -> 'b t -> string_ -> 'b Seq.t

Lazy list of objects associated to strings close to the query string

Sourceval retrieve_l : limit:int -> 'b t -> string_ -> 'b list

List of objects associated to strings close to the query string

  • since 0.3
Sourceval of_list : (string_ * 'b) list -> 'b t

Build an index from a list of pairs of strings and values

Sourceval to_list : 'b t -> (string_ * 'b) list

Extract a list of pairs from an index

Sourceval fold : ('a -> string_ -> 'b -> 'a) -> 'a -> 'b t -> 'a

Fold over the stored pairs string/value

Sourceval iter : (string_ -> 'b -> unit) -> 'b t -> unit

Iterate on the pairs

Sourceval to_seq : 'b t -> (string_ * 'b) Seq.t

Conversion to an iterator

  • since 0.3