Home Manual Reference Source

Function

Static Public Summary
public

* fastScan(p: ArrayLike, pi: number, pj: number, t: ArrayLike<number>, ti: number, s: ArrayLike, si: number, sj: number): IterableIterator<number>

Version of the Matiyasevich-Knuth-Morris-Pratt algorithm that runs quickly when the first symbol of the pattern is not found.

public

* lessCode(p: ArrayLike, pi: number, pj: number, t: ArrayLike<number>, ti: number, s: ArrayLike, si: number, sj: number): IterableIterator<number>

Readble version of the Matiyasevich-Knuth-Morris-Pratt algorithm.

Static Public

public * fastScan(p: ArrayLike, pi: number, pj: number, t: ArrayLike<number>, ti: number, s: ArrayLike, si: number, sj: number): IterableIterator<number> source

Version of the Matiyasevich-Knuth-Morris-Pratt algorithm that runs quickly when the first symbol of the pattern is not found.

NOTE The procedure only works when the pattern and the text have each at least two symbols. Use another method otherwise.

TODO Find a way to pad pattern and text to avoid explicit bound checks.

Params:

NameTypeAttributeDescription
p ArrayLike
pi number
pj number
t ArrayLike<number>
ti number
s ArrayLike
si number
sj number

Return:

IterableIterator<number>

public * lessCode(p: ArrayLike, pi: number, pj: number, t: ArrayLike<number>, ti: number, s: ArrayLike, si: number, sj: number): IterableIterator<number> source

Readble version of the Matiyasevich-Knuth-Morris-Pratt algorithm.

NOTE The procedure only works when the pattern has at least one symbol.

Params:

NameTypeAttributeDescription
p ArrayLike
pi number
pj number
t ArrayLike<number>
ti number
s ArrayLike
si number
sj number

Return:

IterableIterator<number>