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
import fastScan from '@string-searching/matiyasevich-knuth-morris-pratt/src/fastScan.js'
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.
public * lessCode(p: ArrayLike, pi: number, pj: number, t: ArrayLike<number>, ti: number, s: ArrayLike, si: number, sj: number): IterableIterator<number> source
import lessCode from '@string-searching/matiyasevich-knuth-morris-pratt/src/lessCode.js'
Readble version of the Matiyasevich-Knuth-Morris-Pratt algorithm.
NOTE The procedure only works when the pattern has at least one symbol.