Copyright | (c) Oleksandr Zhabenko 2022-2023 |
---|---|
License | MIT |
Maintainer | oleksandr.zhabenko@yahoo.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions | BangPatterns |
Data and algorithmic basics to evaluate rhythmicity of the lists of Ord
instance data type.
Similar to phonetic-languages-rhythmicity
on Hackage.
Synopsis
- showBin :: Int -> [Char]
- unionCount :: Bits a => a -> a -> Integer
- countWeightsQs :: Foldable t => [t a -> Int] -> [t a] -> [[Int]]
- data Sort2 a = S2 {}
- data ASort3 a = As3 {}
- splitF :: Int -> [a] -> [[a]]
- getHashes2 :: Ord a => Int8 -> [Int8] -> [a] -> [[Integer]]
- countHashesPrioritized :: Bits b => [[b]] -> [[Integer]]
- count1Hashes :: Ord a => Int8 -> [Int8] -> [a] -> Integer
- data HashCorrections = H [Int8] Int8
- hashCorrections2F :: HashCorrections -> Int8 -> [Integer] -> Integer
- hashList :: HashCorrections -> [Int8]
- countHashesG :: Ord a => HashCorrections -> Int8 -> [Int8] -> [a] -> [Integer]
- createNewHash :: [Integer] -> Integer
- createHashG :: (Int8 -> [Integer] -> Integer) -> Int8 -> [Integer] -> Integer
- createNHash :: [Int8] -> [Integer] -> Integer
- idList :: Eq a => [Int8] -> [ASort3 a] -> [Int8]
- toNum :: [Int8] -> Integer
- toNum2 :: [Int8] -> Integer
Documentation
showBin :: Int -> [Char] Source #
The similar function is since base-4.16.0.0
in the Numeric
module. Is not used
further, is provided here mostly for testing purposes.
unionCount :: Bits a => a -> a -> Integer Source #
Basic counting of the same bits in the Bits
arguments.
countWeightsQs :: Foldable t => [t a -> Int] -> [t a] -> [[Int]] Source #
Some idea function to evaluate the rhythmicity data. Is not used further in the package, can be thought of as an alternative way of computation.
Data type used to provide somewhat 'array sorting with its indices'.
Data type to contain the needed for hashing algorithm information about the sorted 'array sorting with its indices'.
splitF :: Int -> [a] -> [[a]] Source #
Split the list into lists of n
elements where n
is the first parameter.
:: Ord a | |
=> Int8 | The period of the groups (the length of the lists into which the general sequence is splitted at first). |
-> [Int8] | The list must be sorted in the descending order, the elements must be greater than -1 and less than the first argument here and there must not be repetitions in the list. |
-> [a] | |
-> [[Integer]] |
Function to get basic data for hash-based evaluation of the rhythmicity of the list data. Is
used internally in the countHashesG
.
Provided here mostly for testing purposes.
countHashesPrioritized :: Bits b => [[b]] -> [[Integer]] Source #
Convert hashes into basic simler data to evaluate rhythmicity of the list data.
data HashCorrections Source #
Data type to encode the changes that are introduced by the position of the group
of values in general sequence to the general result of the createHashesG
function. If the second parameter in the HashCorrections
is 1 then the result is more
sensitive to beginning of the line; if it is set to 2 then the result is more sensitive
to ending of the line; if it is greater than 2 then the result is sensitive to some
user weights provided as the first parameter to HashCorrections
and otherwise
the computation result does not depend on the first parameter to HashCorrections
(this
one can be considered the basic option for the computation).
Instances
Read HashCorrections Source # | |
Defined in Rhythmicity.MarkerSeqs | |
Show HashCorrections Source # | |
Defined in Rhythmicity.MarkerSeqs showsPrec :: Int -> HashCorrections -> ShowS # show :: HashCorrections -> String # showList :: [HashCorrections] -> ShowS # | |
Eq HashCorrections Source # | |
Defined in Rhythmicity.MarkerSeqs (==) :: HashCorrections -> HashCorrections -> Bool # (/=) :: HashCorrections -> HashCorrections -> Bool # |
hashCorrections2F :: HashCorrections -> Int8 -> [Integer] -> Integer Source #
hashList :: HashCorrections -> [Int8] Source #
If the second parameter in the HashCorrections
is 1 then the result is more
sensitive to beginning of the line; if it is set to 2 then the result is more sensitive
to ending of the line; if it is greater than 2 then the result is sensitive to some
user weights provided as the first parameter to HashCorrections
and otherwise
the computation result does not depend on the first parameter to HashCorrections
(this
one can be considered the basic option for the computation).
:: Ord a | |
=> HashCorrections | Data that specifies how the arguments influence the result. Somewhat the kernel of the |
-> Int8 | The period of the length of the initial list. |
-> [Int8] | List of ordinary positions of the maximum-minimum levels for values of the list in the group. The length of the unique elements together in the list is expected to be in the list [1..7]. |
-> [a] | |
-> [Integer] |
General implementation of the hash-based algorithm to evaluate the level of rhythmicity of the list data. The relatively greater result (for PhLADiPreLiO) corresponds to greater detected periodicity.
createNewHash :: [Integer] -> Integer Source #
Provided for testing.
createHashG :: (Int8 -> [Integer] -> Integer) -> Int8 -> [Integer] -> Integer Source #
General implementation of the second hashing of the data for the algorithm.
createNHash :: [Int8] -> [Integer] -> Integer Source #
A variant of the createHashG
that actually must be equal to the createNewHash
for the
second argument lists
with less than 8 elements. For greater values is not correctly defined, so do not use it for
the lists with 8 or more elements in them. Actually should be equal to createNewHash
for the
second argument.
idList :: Eq a => [Int8] -> [ASort3 a] -> [Int8] Source #
Function to filter the elements by the second parameter of the ASort3
data
and then to get the first ones.