-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Library to deal with rhythmicity of short sequences -- -- The library deals with the model similar to the one given at the work -- https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.pdf -- and -- https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array @package rhythmic-sequences @version 0.2.2.0 -- | Functions for Rhythmicity.MarkerSeqs module that additionally -- "catches" some hashing logics so that they can influence in the -- predictable way the peculiarities of the results for PhLADiPreLiO. module Rhythmicity.BasicF hashPosLF2 :: Int8 -> [Integer] -> Integer hashBalancingLF2 :: Int8 -> [Integer] -> Integer hashBasicLF2 :: Int8 -> [Integer] -> Integer -- | Data and algorithmic basics to evaluate rhythmicity of the lists of -- Ord instance data type. Similar to -- phonetic-languages-rhythmicity on Hackage. module Rhythmicity.MarkerSeqs -- | 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. showBin :: Int -> [Char] -- | Basic counting of the same bits in the Bits arguments. unionCount :: Bits a => a -> a -> Integer -- | 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. countWeightsQs :: Foldable t => [t a -> Int] -> [t a] -> [[Int]] -- | Data type used to provide somewhat 'array sorting with its indices'. data Sort2 a S2 :: Int8 -> a -> Sort2 a [id] :: Sort2 a -> Int8 [val] :: Sort2 a -> a -- | Data type to contain the needed for hashing algorithm information -- about the sorted 'array sorting with its indices'. data ASort3 a As3 :: Int8 -> Int8 -> a -> ASort3 a [id3] :: ASort3 a -> Int8 [orD] :: ASort3 a -> Int8 [val3] :: ASort3 a -> a -- | Split the list into lists of n elements where n is -- the first parameter. splitF :: Int -> [a] -> [[a]] -- | 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. getHashes2 :: Ord a => Int8 -> [Int8] -> [a] -> [[Integer]] -- | Convert hashes into basic simler data to evaluate rhythmicity of the -- list data. countHashesPrioritized :: Bits b => [[b]] -> [[Integer]] -- | Mostly for testing. count1Hashes :: Ord a => Int8 -> [Int8] -> [a] -> Integer -- | 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). data HashCorrections H :: [Int8] -> Int8 -> HashCorrections hashCorrections2F :: HashCorrections -> Int8 -> [Integer] -> Integer -- | 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). hashList :: HashCorrections -> [Int8] -- | If you would like to specify just your own values then specify the -- Lexeme "a..." where 'a' here means the minus sign '-' or some -- not equal to 1 or 2 digit, instead of dots specify some digits that -- are the beginning of the [Int8] list in HashCorrections. -- If 'a' is '-', then the next not equal to 'a' symbol should be some -- digit not equal to 1 or 2 if you want to specify your own list of -- [Int8] for HashCorrections. -- -- Caution: -- --
-- readHashCorrections . show $ xs /= xs ---- --
-- show . readHashCorrections $ xs /= xs ---- -- in general case. The default value is H [0,0..] 0. This one -- corresponds to usage of the hashBalancingLF2 without any -- corrections (equi-sensitive to all the parts of the line except -- probably the last syllables if the number of syllables is not wholely -- divisible without remainder to the groupLength parameter in the -- countHashesG function). readHashCorrections :: String -> HashCorrections -- | This is used to provide the second and the third arguments to -- countHashesG function. The default value is (4,[3,2]). -- This means that the line is divided into groups of 4-syllables then -- there are searched for rhythmic repetitions of the positions of the -- most maximum values and the less maximum values. This scheme should is -- related to disyllables metrical feet for SaaW (syllables-as-a-whole) -- mode of operation for PhLADiPreLiO (see: -- https://oleksandrzhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.html#SaaW). -- For more information on the metrical feet you can see e. g. -- --
-- @article{kagerfeet,
-- title={Feet and metrical stress},
-- author={Kager, Rene},
-- journal={This page intentionally left blank},
-- pages={195}
-- }
--
grouppingR :: String -> (Int8, [Int8])
-- | 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.
countHashesG :: Ord a => HashCorrections -> Int8 -> [Int8] -> [a] -> [Integer]
-- | Provided for testing.
createNewHash :: [Integer] -> Integer
-- | General implementation of the second hashing of the data for the
-- algorithm.
createHashG :: (Int8 -> [Integer] -> Integer) -> Int8 -> [Integer] -> Integer
-- | 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.
createNHash :: [Int8] -> [Integer] -> Integer
-- | Function to filter the elements by the second parameter of the
-- ASort3 data and then to get the first ones.
idList :: Eq a => [Int8] -> [ASort3 a] -> [Int8]
-- | Function to create bitwise representation of the intermediate data for
-- the algorithm. Should be very optimized to run fast.
toNum :: [Int8] -> Integer
-- | The alternative implementation of the toNum (on the Linux
-- x86_64 for some CPU is slower than the former one).
toNum2 :: [Int8] -> Integer
instance GHC.Show.Show Rhythmicity.MarkerSeqs.HashCorrections
instance GHC.Classes.Eq Rhythmicity.MarkerSeqs.HashCorrections
instance GHC.Classes.Eq a => GHC.Classes.Eq (Rhythmicity.MarkerSeqs.ASort3 a)
instance GHC.Show.Show a => GHC.Show.Show (Rhythmicity.MarkerSeqs.ASort3 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Rhythmicity.MarkerSeqs.Sort2 a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Rhythmicity.MarkerSeqs.Sort2 a)
instance GHC.Base.Functor Rhythmicity.MarkerSeqs.Sort2
instance GHC.Show.Show a => GHC.Show.Show (Rhythmicity.MarkerSeqs.Sort2 a)