Stability | experimental |
---|---|
Maintainer | Danil de Kok <me@danieldk.eu> |
Construction of suffix arrays (arrays ordered by suffix). Given an array d elements, the suffix array is a sorted array of the sub-arrays in d. For instance, the suffix array of banana apple pear apple is:
- apple
- apple pear apple
- banana apple pear apple
- pear apple
- data SuffixArray a = SuffixArray (Vector a) (Vector Int)
- fromList :: Ord a => [a] -> SuffixArray a
- suffixArray :: Ord a => Vector a -> SuffixArray a
- suffixArrayBy :: Ord a => (Vector a -> Vector a -> Ordering) -> Vector a -> SuffixArray a
- toList :: SuffixArray a -> [[a]]
Documentation
fromList :: Ord a => [a] -> SuffixArray aSource
fromList
constructs a suffix array from a list of elements.
suffixArray :: Ord a => Vector a -> SuffixArray aSource
suffixArray
is a specialization of suffixArrayBy
that uses the
default compare
function.
suffixArrayBy :: Ord a => (Vector a -> Vector a -> Ordering) -> Vector a -> SuffixArray aSource
suffixArrayBy
constructs a suffix array. The sorting order is determined
by the supplied compare function.
toList :: SuffixArray a -> [[a]]Source
toList
constructs a list from a suffix array.