palindromes-0.3.2: Finding palindromes in strings

Safe HaskellSafe-Infered

Data.Algorithms.Palindromes.Palindromes

Synopsis

Documentation

longestPalindrome :: ByteString -> StringSource

longestPalindrome returns the longest palindrome in a string.

maximalPalindromes :: ByteString -> StringSource

maximalPalindromes returns the maximal palindrome around each position in a string.

maximalPalindromesLengthAtLeast :: Int -> ByteString -> StringSource

maximalPalindromesLengthAtLeast returns the longest palindrome around each position in a string. The integer argument is used to only show palindromes of length at least this integer.

maximalPalindromesLengthBetween :: Int -> Int -> ByteString -> StringSource

maximalPalindromesLengthBetween returns the longest palindrome around each position in a string. The integer arguments are used to only show palindromes of length in between the specified lengths.

maximalPalindromesLengthAtMost :: Int -> ByteString -> StringSource

maximalPalindromesLengthAtMost returns the longest palindrome around each position in a string. The integer arguments are used to only show palindromes of length in between the specified lengths.

palindromesLengthExact :: Int -> ByteString -> StringSource

palindromesLengthExact returns the longest palindrome around each position in a string. The integer arguments are used to only show palindromes of length in between the specified lengths.

lengthLongestPalindrome :: ByteString -> StringSource

lengthLongestPalindrome returns the length of the longest palindrome in a string.

lengthMaximalPalindromes :: ByteString -> StringSource

lengthMaximalPalindromes returns the lengths of the longest palindrome around each position in a string.

longestTextPalindrome :: ByteString -> StringSource

longestTextPalindrome returns the longest text palindrome in a string, ignoring spacing, punctuation symbols, and case of letters.

maximalTextPalindromesLengthAtLeast :: Int -> ByteString -> StringSource

longestTextPalindromes returns the longest text palindrome around each position in a string. The integer argument is used to only show palindromes of length at least this integer.

longestWordPalindrome :: ByteString -> StringSource

longestWordPalindrome returns the longest text palindrome preceded and followed by non-letter symbols (if any).

maximalWordPalindromesLengthAtLeast :: Int -> ByteString -> StringSource

longestWordPalindromes returns the longest word palindrome around each position in a string. The integer argument is used to only show palindromes of length at least this integer.

palindromesAroundCentres :: ByteString -> [Int]Source

palindromesAroundCentres is the central function of the module. It returns the list of lenghths of the longest palindrome around each position in a string.