Library
Module
Module type
Parameter
Class
Class type
A functor for building a Tfidf search index over different types of document.
type key = Uid.t
module Witness : sig ... end
module Uid : sig ... end
type 'v uid = 'v Uid.witness
A value of type 'v uid
can be used to uniquely identify documents of type 'a
.
type doc = binding
Documents are bindings.
index t doc uid
indexes a given document doc
in t
with a unique identifier uid
.
apply uid ~default fn doc
runs the function fn
on doc
if uid
identifies the types as being the same, otherwise it returns default
.
Like apply
except without a default return value so it may raise Invalid_argument _
.
Adds a new index and re-indexes everything.
Same as add_index
but allows you to add multiple indexes at a time before re-indexing occurs.
search t k
searches the index t
using k
returning the possible bindings.
val empty :
?santiser:(string -> string) ->
?strategy:(string -> string list) ->
?tokeniser:(string -> string list) ->
unit ->
t
Create a new empty search index.
val pp : Format.formatter -> t -> unit
Dumps the search index.