package wu-manber-fuzzy-search

  1. Overview
  2. Docs

Make (P) (M) creates a set of functions for finding the first match in a sequnce and reporting the number of errors and the position at which the match ends. See the functor documentation for more details.

The search functions in this module stop after the first match, and returns the error count together with the number of characters of the text read by the algorithm.

Parameters

module M : Matcher.Matcher with type pattern := P.t and type elem := P.elem

Signature

val first_match : pattern:P.t -> k:int -> P.elem Stdlib.Seq.t -> (int * int * Optint.Int63.t array) option

Searches for the first match in a sequence using the basic Wu and Manber algorithm. ~pattern must have length less than or equal 63.

val first_right_leaning_match : pattern:P.t -> k:int -> P.elem Stdlib.Seq.t -> (int * int * Optint.Int63.t array) option

Searches for the first match in a sequence using the right leaning variant of the Wu and Manber algorithm. ~pattern must have length less than or equal 63.

val report : (int * int * Optint.Int63.t array) option -> string

report produces a texual description of the results of the above functions.