Copyright | Joshua Simmons 2017 |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Safe Haskell | None |
Language | Haskell2010 |
Data.SuffixArray
Description
Suffix array library main module
- data SuffixArray a = SuffixArray {}
- suffixArray :: Ord a => [[a]] -> SuffixArray a
- suffixArrayOne :: Ord a => [a] -> SuffixArray a
- data Alpha a
- justAlphas :: SuffixArray a -> [Alpha a]
- justLcp :: SuffixArray a -> [Int]
- justSuffixes :: SuffixArray a -> [Int]
Documentation
data SuffixArray a Source #
Holds the computed suffix array data
Constructors
SuffixArray | |
Instances
Eq a => Eq (SuffixArray a) Source # | |
Ord a => Ord (SuffixArray a) Source # | |
Show a => Show (SuffixArray a) Source # | |
suffixArray :: Ord a => [[a]] -> SuffixArray a Source #
Compute the suffix array of the given string(s) concatenated together
with Sentinal
s after each.
worst case O(n lg n) time (where n is the sum of the string lengths + the number of strings)
suffixArrayOne :: Ord a => [a] -> SuffixArray a Source #
Convenience function to compute the suffix array of a single string.
(Still gets a Sentinal
at the end)
worst case O(n lg n) time (where n is the length of the string)
A character in a string (or set of strings) we're going to compute the
suffix array of.
Includes Sentinal
markers for the end of strings.
justAlphas :: SuffixArray a -> [Alpha a] Source #
Convenience function to just give a list characters in the concatenated original strings.
justLcp :: SuffixArray a -> [Int] Source #
Convenience function to just give a list of the longest common prefix of every suffix with the previous suffix in lexicographic order.
justSuffixes :: SuffixArray a -> [Int] Source #
Convenience function to just give a list of the suffixes in lexicographic order.