package wu-manber-fuzzy-search

  1. Overview
  2. Docs

Patterns with a fold right operation where the elements can enumerated from 0 to some max_elem_index.

include Patterns.PatternWithFoldRight
include Patterns.PatternWithElemEquality
include Patterns.Pattern
type t

The type of patterns.

val length : t -> int
include Patterns.ElemsWithEquality
include Patterns.Elems
type elem

The type of characters in the patterns.

val elem_eq : elem -> elem -> bool

Operation to check if two characters are equal.

val fold_right : (elem -> 'a -> 'a) -> t -> 'a -> 'a
include Patterns.ElemsIndexable with type elem := elem
include Patterns.Elems with type elem := elem
val int_of_elem : elem -> int

Convert elements to int.

val elem_of_int : int -> elem

elem_of_int n should convert an n between 0 and max_elem_index (inclusive) to an element.

val max_elem_index : int

The maximal index for elements. The maximal index should be the last index that an element can be mapped to.

Note: This is 1 less than the total number of elements. For example, there are a total of 256 chars, but char can be enumerated from 0 to 255, so max_elem_index for chars should be 255.