phonetic-languages-rhythmicity 0.10.0.0 → 0.10.1.0
raw patch · 3 files changed
+21/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- Phladiprelio/Rhythmicity/Factor.hs +17/−16
- phonetic-languages-rhythmicity.cabal +1/−1
CHANGELOG.md view
@@ -102,3 +102,6 @@ * Tenth version. Switched to NoImplicitPrelude extension. Changed the computational schemes in the Phladiprelio.Rhythmicity.Simple and Phladiprelio.Rhythmicity.Factor modules. Updated the dependency boundaries. +## 0.10.1.0 -- 2023-02-05++* Tenth version revised A. Fixed issues with maxPosition2F function.
Phladiprelio/Rhythmicity/Factor.hs view
@@ -32,7 +32,7 @@ readFactors :: String -> Factors readFactors xs | length xs == 10 = let (x1:x2:x3:x4:x5:x6:x7:x8:x9:[x10]) = map f2 xs in F x1 x2 x3 x4 x5 x6 x7 x8 x9 x10- | otherwise = undefined+ | otherwise = defFactors where f2 x | isDigit x = read [x]::Double | otherwise = case x of { 'p' -> 4.743; 'i' -> 4.153; ~rrr -> 0 }@@ -43,22 +43,23 @@ | null xs = 0.0 | otherwise = maxP21 ff k xs 0 where maxP21 ff k (x:ks@(y:t:ys)) !acc1 - | abs (x - t) / max x t < 0.05 = maxP21 ff k ks (acc1 + f1 ff k s y w acc1)- | otherwise = maxP21 ff k ks (acc1 + f ff k s y w acc1)- where s = min x t- w = max x t- f ff@(F x1 x2 x3 x4 x5 x6 x7 x8 x9 x10) k s y w acc - | t > w = if - | t >= k * s && t <= k*w -> x1 -- the default is 5.0- | t < k*s -> x2 -- the default is 4.0- | t > k*w -> x3 -- the default is 3.0- | t > s = x4 -- the default is 2.0- | t < s = x5 -- the default is 1.0- | t == w = x6 -- the default is 4.743+ | abs (x - t) / max x t < 0.05 = maxP21 ff k ks (acc1 + f1 ff k s y w)+ | otherwise = maxP21 ff k ks (acc1 + f ff k s y w)+ where (s, w) + | t > x = (x, t)+ | otherwise = (t, x)+ f ff@(F x1 x2 x3 x4 x5 x6 x7 x8 x9 x10) k s y w+ | y > w = if + | y >= k * s && y <= k*w -> x1 -- the default is 5.0+ | y < k*s -> x2 -- the default is 4.0+ | otherwise -> x3 -- the default is 3.0+ | y > s = x4 -- the default is 2.0+ | y < s = x5 -- the default is 1.0+ | y == w = x6 -- the default is 4.743 | otherwise = x7 -- the default is 4.153- f1 ff@(F x1 x2 x3 x4 x5 x6 x7 x8 x9 x10) k s y w acc - | t > w = x8 -- the default is 5.0- | t < s = x9 -- the default is 4.0+ f1 ff@(F x1 x2 x3 x4 x5 x6 x7 x8 x9 x10) k s y w+ | y > w = x8 -- the default is 5.0+ | y < s = x9 -- the default is 4.0 | otherwise = x10 -- the default is 3.0 maxP21 _ _ _ !acc1 = acc1
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.10.0.0+version: 0.10.1.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.