packages feed

phonetic-languages-rhythmicity 0.5.4.0 → 0.6.0.0

raw patch · 4 files changed

+91/−16 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Rhythmicity.PolyRhythm: decreasingF1 :: Int -> Double -> Double
+ Rhythmicity.PolyRhythm: decreasingFG :: Int -> Double -> (Int -> Double -> Double -> Double) -> Double -> Double
+ Rhythmicity.PolyRhythm: decreasingFG2 :: Int -> Double -> (Double -> Double -> Double) -> Double -> Double
+ Rhythmicity.PolyRhythm: increasingF1 :: Int -> Double -> Double
+ Rhythmicity.PolyRhythm: increasingFG :: Int -> Double -> (Int -> Double -> Double -> Double) -> Double -> Double
+ Rhythmicity.PolyRhythm: increasingFG2 :: Int -> Double -> (Double -> Double -> Double) -> Double -> Double

Files

CHANGELOG.md view
@@ -62,3 +62,9 @@ * Fifth version revised D. Fixed issue with x == 0.0 for the long lines for the numeric increasing and decreasing functions for the polyrhythmicity. +## 0.6.0.0 -- 2021-08-09++* Sixth version. Changed the increasing and decreasing functions for the polyrhythms and added new possibilities+among which there are also generalized kernel-based functions. This should linearize and allow to specify different+kernels that allows to control which parts of the line are the most important and which are less. Added the+information to the README.md file.
README.md view
@@ -96,3 +96,8 @@ another. This leads to that fact that these functions now are expected to be smoother for usage for the beginning of the line, its middle and its ending.++Since the 0.6.0.0 version these functions became more+linearized and there is also library possibility to+specify kernels for them to control which parts+of the line are more important and which are less.
Rhythmicity/PolyRhythm.hs view
@@ -222,7 +222,70 @@  | x < 1 = x ** (1.0 / int2Double n)  | x <= 1.1 = x + 1.0 / int2Double n  | otherwise = x ^ n+{-# INLINE increasingF #-}  +increasingF1+ :: Int+ -> Double+ -> Double+increasingF1 n x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.increasingF1: not defined for the argument. " ++ show n+ | otherwise = x + int2Double n+{-# INLINE increasingF1 #-}++increasingFG+ :: Int+ -> Double+ -> (Int -> Double -> Double -> Double)+ -> Double+ -> Double+increasingFG n k f x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.increasingFG: not defined for the argument. " ++ show n+ | otherwise = x + abs (f n k x)+{-# INLINE increasingFG #-} ++decreasingF1+ :: Int+ -> Double+ -> Double+decreasingF1 n x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.decreasingF1: not defined for the argument. " ++ show n+ | otherwise = x - int2Double n+{-# INLINE decreasingF1 #-} ++decreasingFG+ :: Int+ -> Double+ -> (Int -> Double -> Double -> Double)+ -> Double+ -> Double+decreasingFG n k f x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.decreasingFG: not defined for the argument. " ++ show n+ | otherwise = x - abs (f n k x)+{-# INLINE decreasingFG #-} ++decreasingFG2+ :: Int+ -> Double+ -> (Double -> Double -> Double)+ -> Double+ -> Double+decreasingFG2 n k f x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.decreasingFG2: not defined for the argument. " ++ show n+ | otherwise = x - int2Double n * abs (f k x)+{-# INLINE decreasingFG2 #-}++increasingFG2+ :: Int+ -> Double+ -> (Double -> Double -> Double)+ -> Double+ -> Double+increasingFG2 n k f x+ | n <= 0 = error $ "Rhythmicity.PolyRhythm.increasingFG2: not defined for the argument. " ++ show n+ | otherwise = x + int2Double n * abs (f k x)+{-# INLINE increasingFG2 #-} + decreasingF  :: Int  -> Double@@ -234,6 +297,7 @@  | x < 1 = x ** int2Double n  | x <= 1.1 = 1.0 / (x + 1.0 / int2Double n)  | otherwise = x ** (1.0 / int2Double n)+{-# INLINE decreasingF #-}   similarityF1  :: Char -- ^ The start of the counting.@@ -244,19 +308,19 @@ similarityF1 c m1 m2 x0  | is4s m1 = if     | m1 == m2 -> case (\(R4 t0) -> t0) m1 of-        D -> increasingF 4 x0-        E -> increasingF 3 x0-        F -> increasingF 2 x0-        _ -> increasingF 1 x0+        D -> increasingF1 4 x0+        E -> increasingF1 3 x0+        F -> increasingF1 2 x0+        _ -> increasingF1 1 x0     | otherwise -> case (\(R4 t0) -> t0) . min m1 $ m2 of-        D -> decreasingF 4 x0-        E -> decreasingF 3 x0-        F -> decreasingF 2 x0-        _ -> decreasingF 1 x0+        D -> decreasingF1 4 x0+        E -> decreasingF1 3 x0+        F -> decreasingF1 2 x0+        _ -> decreasingF1 1 x0  | otherwise = let n = length [c..(\(RP (PolyMs t0)) -> t0) (min m1 m2)] in      if-       | m1 == m2 -> increasingF n x0-       | otherwise -> decreasingF n x0+       | m1 == m2 -> increasingF1 n x0+       | otherwise -> decreasingF1 n x0 {-# INLINE similarityF1 #-}   {-| The more straightforward variant of the 'similarityF1' function. -}@@ -269,14 +333,14 @@ similarityF0 c m1 m2 x0  | is4s m1 = if     | m1 == m2 -> case (\(R4 t0) -> t0) m1 of-        D -> increasingF 4 x0-        E -> increasingF 3 x0-        F -> increasingF 2 x0-        _ -> increasingF 1 x0+        D -> increasingF1 4 x0+        E -> increasingF1 3 x0+        F -> increasingF1 2 x0+        _ -> increasingF1 1 x0     | otherwise -> x0  | otherwise = let n = length [c..(\(RP (PolyMs t0)) -> t0) (min m1 m2)] in      if-       | m1 == m2 -> increasingF n x0+       | m1 == m2 -> increasingF1 n x0        | otherwise -> x0 {-# INLINE similarityF0 #-}  
phonetic-languages-rhythmicity.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/  name:                phonetic-languages-rhythmicity-version:             0.5.4.0+version:             0.6.0.0 synopsis:            Allows to estimate the rhythmicity properties for the text description:         Allows to estimate (somewhat to say, evaluate) the rhythmicity properties for the text. Inspired by the ancient Greek and Latin poetry.