Header menu logo BioFSharp

RabinKarp Module

A collection of Rabin-Karp string matching algorithms and hash functions

Nested modules

Modules Description

CP

A collection of Rabin-Karp string matching algorithms using the cyclic polynomial (CP) hash

RKStandard

A collection of Rabin-Karp string matching algorithms using the built-in hash function of f#

Functions and values

Function or value Description

findAllGeneric updateHash blockHash pattern s

Full Usage: findAllGeneric updateHash blockHash pattern s

Parameters:
    updateHash : 'c -> 'a -> 'a -> 'c
    blockHash : 'a array -> 'c
    pattern : 'a array
    s : 'a array

Returns: int list
Modifiers: inline
Type parameters: 'c, 'a

takes an updateHash and blockHash function to find all matches of a query pattern in a source

updateHash : 'c -> 'a -> 'a -> 'c
blockHash : 'a array -> 'c
pattern : 'a array
s : 'a array
Returns: int list

findFromGeneric startPos updateHash blockHash pattern text

Full Usage: findFromGeneric startPos updateHash blockHash pattern text

Parameters:
    startPos : int
    updateHash : 'c -> 'a -> 'a -> 'c
    blockHash : 'a array -> 'c
    pattern : 'a array
    text : 'a array

Returns: int

takes an updateHash and blockHash function to find the first match of a query pattern in a source starting from a specific position in the source

startPos : int
updateHash : 'c -> 'a -> 'a -> 'c
blockHash : 'a array -> 'c
pattern : 'a array
text : 'a array
Returns: int

isMatchAt pattern s startPos

Full Usage: isMatchAt pattern s startPos

Parameters:
    pattern : 'a array
    s : 'a array
    startPos : int

Returns: bool

checks if content of pattern and source substring match

pattern : 'a array
s : 'a array
startPos : int
Returns: bool

Type something to start searching.