packages feed

phonetic-languages-properties 0.1.2.0 → 0.2.0.0

raw patch · 4 files changed

+126/−24 lines, 4 filesdep ~ukrainian-phonetics-basicPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ukrainian-phonetics-basic

API changes (from Hackage documentation)

+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procBoth2F :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procBoth2Fneg :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procBoth2InvF :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procBoth2InvFneg :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procRhythmicity232F :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesFuncRepG: procRhythmicity232Fneg :: FuncRep (Vector Char) (UniquenessGeneral2 Char) [Float]
+ Languages.UniquenessPeriods.Vector.PropertiesSyllablesG: rhythmicity02 :: String -> Float
+ Languages.UniquenessPeriods.Vector.PropertiesSyllablesG: rhythmicityK2 :: Float -> Float -> String -> Float
+ Languages.UniquenessPeriods.Vector.PropertiesSyllablesG: rhythmicityV02 :: Vector Char -> Float
+ Languages.UniquenessPeriods.Vector.PropertiesSyllablesG: rhythmicityVK2 :: Float -> Float -> Vector Char -> Float

Files

CHANGELOG.md view
@@ -12,3 +12,6 @@  * First version revised B. Changed the dependency boundaries so that it uses the latest versions. +## 0.2.0.0 -- 2020-11-07++* Second version. Added new metrices based on the new syllable durations generated with r-glpk-phonetic-languages-ukrainian-durations package.
Languages/UniquenessPeriods/Vector/PropertiesFuncRepG.hs view
@@ -24,6 +24,13 @@   , procBothFneg   , procBothInvF   , procBothInvFneg+  -- ** Working with generated by r-glpk-phonetic-languages-ukrainian-durations syllable durations+  , procRhythmicity232F+  , procRhythmicity232Fneg+  , procBoth2F+  , procBoth2Fneg+  , procBoth2InvF+  , procBoth2InvFneg ) where  #ifdef __GLASGOW_HASKELL__@@ -69,39 +76,96 @@ {-# INLINE procDiverse2Fneg #-}  procRhythmicity23F :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procRhythmicity23F = U1 ((:[]) . rhythmicityV0)+procRhythmicity23F = procRhythm23F rhythmicityV0 {-# INLINE procRhythmicity23F #-}  -- | Can be used to find out the minimum element. procRhythmicity23Fneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procRhythmicity23Fneg = U1 ((:[]) . negate . rhythmicityV0)+procRhythmicity23Fneg = procRhythm23Fneg rhythmicityV0 {-# INLINE procRhythmicity23Fneg #-}  procBothF :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procBothF = U1 (\v -> let ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v in (:[]) ((int2Float . fromEnum . diverse2 . uniquenessPeriodsVector3 " 01-" . VB.fromList $ ys)*(evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)))+procBothF = procB2F syllableDurations {-# INLINE procBothF #-}  -- | Can be used to find out the minimum element. procBothFneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procBothFneg = U1 (\v -> let ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v in (:[]) ((int2Float . negate . fromEnum . diverse2 . uniquenessPeriodsVector3 " 01-" .-    VB.fromList$ ys)*(evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)))+procBothFneg = procB2Fneg syllableDurations {-# INLINE procBothFneg #-}  procBothInvF :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procBothInvF = U1 (\v ->-  let !ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v-      !zs = uniquenessPeriodsVector3 " 01-" . VB.fromList $ ys in if VB.null zs then (:[]) ((evalRhythmicity23 . mconcat . syllableDurations . map (divVwls .-     reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) * (evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts .-       groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)) else (:[]) ((evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts . groupSnds .-         vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) / (int2Float . fromEnum . diverse2 $ zs)))+procBothInvF = procB2InvF syllableDurations {-# INLINE procBothInvF #-}  -- | Can be used to find out the minimum element. procBothInvFneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]-procBothInvFneg = U1 (\v ->+procBothInvFneg = procB2InvFneg syllableDurations+{-# INLINE procBothInvFneg #-}++-------------------------------------------------------------------------------++procRhythmicity232F :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procRhythmicity232F = procRhythm23F rhythmicityV02+{-# INLINE procRhythmicity232F #-}++-- | Can be used to find out the minimum element.+procRhythmicity232Fneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procRhythmicity232Fneg = procRhythm23Fneg rhythmicityV02+{-# INLINE procRhythmicity232Fneg #-}++procBoth2F :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procBoth2F = procB2F syllableDurations2+{-# INLINE procBoth2F #-}++-- | Can be used to find out the minimum element.+procBoth2Fneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procBoth2Fneg = procB2Fneg syllableDurations2+{-# INLINE procBoth2Fneg #-}++procBoth2InvF :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procBoth2InvF = procB2InvF syllableDurations2+{-# INLINE procBoth2InvF #-}++-- | Can be used to find out the minimum element.+procBoth2InvFneg :: FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procBoth2InvFneg = procB2InvFneg syllableDurations2+{-# INLINE procBoth2InvFneg #-}++-------------------------------------------------------------++procRhythm23F :: (VB.Vector Char -> Float) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procRhythm23F g = U1 ((:[]) . g)+{-# INLINE procRhythm23F #-}++procRhythm23Fneg :: (VB.Vector Char -> Float) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procRhythm23Fneg g = U1 ((:[]) . negate . g)+{-# INLINE procRhythm23Fneg #-}++procB2F :: ([[[UZPP2]]] -> [[Float]]) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procB2F g = U1 (\v -> let ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v in (:[]) ((int2Float . fromEnum . diverse2 . uniquenessPeriodsVector3 " 01-" . VB.fromList $ ys)*(evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)))+{-# INLINE procB2F #-}++-- | Can be used to find out the minimum element.+procB2Fneg :: ([[[UZPP2]]] -> [[Float]]) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procB2Fneg g = U1 (\v -> let ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v in (:[]) ((int2Float . negate . fromEnum . diverse2 . uniquenessPeriodsVector3 " 01-" .+    VB.fromList$ ys)*(evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)))+{-# INLINE procB2Fneg #-}++procB2InvF :: ([[[UZPP2]]] -> [[Float]]) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procB2InvF g = U1 (\v ->+  let !ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v+      !zs = uniquenessPeriodsVector3 " 01-" . VB.fromList $ ys in if VB.null zs then (:[]) ((evalRhythmicity23 . mconcat . g . map (divVwls .+     reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) * (evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts .+       groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)) else (:[]) ((evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts . groupSnds .+         vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) / (int2Float . fromEnum . diverse2 $ zs)))+{-# INLINE procB2InvF #-}++-- | Can be used to find out the minimum element.+procB2InvFneg :: ([[[UZPP2]]] -> [[Float]]) -> FuncRep (VB.Vector Char) (UniquenessGeneral2 Char) [Float]+procB2InvFneg g = U1 (\v ->    let !ys = convertToProperUkrainianV2S . VB.map (\x -> if x == '-' then ' ' else x) $ v-       !zs = uniquenessPeriodsVector3 " 01-" .VB.fromList $ ys in if VB.null zs then (:[]) (negate (evalRhythmicity23 . mconcat . syllableDurations . map (divVwls .-     reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) * (evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts .-       groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)) else (:[]) ((evalRhythmicity23 . mconcat . syllableDurations . map (divVwls . reSyllableCntnts . groupSnds .+       !zs = uniquenessPeriodsVector3 " 01-" .VB.fromList $ ys in if VB.null zs then (:[]) (negate (evalRhythmicity23 . mconcat . g . map (divVwls .+     reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) * (evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts .+       groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys)) else (:[]) ((evalRhythmicity23 . mconcat . g . map (divVwls . reSyllableCntnts . groupSnds .          vec2UZPP2s) . vecWords . V.filter (/='0') . V.fromList $ ys) / (int2Float . negate .  fromEnum . diverse2 $ zs)))-{-# INLINE procBothInvFneg #-}+{-# INLINE procB2InvFneg #-}
Languages/UniquenessPeriods/Vector/PropertiesSyllablesG.hs view
@@ -12,13 +12,20 @@ {-# LANGUAGE CPP #-}  module Languages.UniquenessPeriods.Vector.PropertiesSyllablesG (-  -- * Rhythmicity metrices-  -- ** A simple one+  -- * Rhythmicity metrices (semi-empirical)+  -- ** Simple ones   rhythmicity0   , rhythmicityV0   -- ** With weight coefficients   , rhythmicityVK   , rhythmicityK+  -- * Rhythmicity metrices from generated with r-glpk-phonetic-languages-ukrainian-durations package (since 0.2.0.0 version)+  -- ** Simple ones+  , rhythmicity02+  , rhythmicityV02+  -- ** With weight coefficients+  , rhythmicityVK2+  , rhythmicityK2 ) where  #ifdef __GLASGOW_HASKELL__@@ -38,22 +45,50 @@ #endif #endif +eval23 = evalRhythmicity23 . mconcat+{-# INLINE eval23 #-}++eval23K k2 k3 = evalRhythmicity23K k2 k3 . mconcat+{-# INLINE eval23K #-}+ rhythmicity0 :: String -> Float rhythmicity0 xs  | null xs = 0.0- | otherwise = evalRhythmicity23 . mconcat . syllableDurations . createSyllablesUkr $ xs+ | otherwise = eval23 . syllableDurations . createSyllablesUkr $ xs  rhythmicityK :: Float -> Float -> String -> Float rhythmicityK k2 k3 xs  | null xs = 0.0- | otherwise = evalRhythmicity23K k2 k3 . mconcat . syllableDurations . createSyllablesUkrP $ xs+ | otherwise = eval23K k2 k3 . syllableDurations . createSyllablesUkrP $ xs  rhythmicityV0 :: VB.Vector Char -> Float rhythmicityV0 v  | VB.null v = 0.0- | otherwise = evalRhythmicity23 . mconcat . syllableDurations . createSyllablesUkrV $ v+ | otherwise = eval23 . syllableDurations . createSyllablesUkrV $ v  rhythmicityVK :: Float -> Float -> VB.Vector Char -> Float rhythmicityVK k2 k3 v  | VB.null v = 0.0- | otherwise = evalRhythmicity23K k2 k3 . mconcat . syllableDurations . createSyllablesUkrVP $ v+ | otherwise = eval23K k2 k3 . syllableDurations . createSyllablesUkrVP $ v++-------------------------------------------------------++rhythmicity02 :: String -> Float+rhythmicity02 xs+ | null xs = 0.0+ | otherwise = eval23 . syllableDurations2 . createSyllablesUkr $ xs++rhythmicityK2 :: Float -> Float -> String -> Float+rhythmicityK2 k2 k3 xs+ | null xs = 0.0+ | otherwise = eval23K k2 k3 . syllableDurations2 . createSyllablesUkrP $ xs++rhythmicityV02 :: VB.Vector Char -> Float+rhythmicityV02 v+ | VB.null v = 0.0+ | otherwise = eval23 . syllableDurations2 . createSyllablesUkrV $ v++rhythmicityVK2 :: Float -> Float -> VB.Vector Char -> Float+rhythmicityVK2 k2 k3 v+ | VB.null v = 0.0+ | otherwise = eval23K k2 k3 . syllableDurations2 . createSyllablesUkrVP $ v
phonetic-languages-properties.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/  name:                phonetic-languages-properties-version:             0.1.2.0+version:             0.2.0.0 synopsis:            A generalization of the uniqueness-periods-vector-properties package. -- description: homepage:            https://hackage.haskell.org/package/phonetic-languages-properties@@ -20,6 +20,6 @@   exposed-modules:     Languages.UniquenessPeriods.Vector.PropertiesG, Languages.UniquenessPeriods.Vector.PropertiesFuncRepG, Languages.UniquenessPeriods.Vector.PropertiesSyllablesG   -- other-modules:   other-extensions:    BangPatterns, CPP-  build-depends:       base >=4.7 && <4.15, vector >=0.11 && <0.14, phonetic-languages-vector >=0.1 && <1, phonetic-languages-rhythmicity >=0.1.2 && <1, phonetic-languages-common >=0.1.1 && <1, ukrainian-phonetics-basic >=0.1.11 && <1+  build-depends:       base >=4.7 && <4.15, vector >=0.11 && <0.14, phonetic-languages-vector >=0.1 && <1, phonetic-languages-rhythmicity >=0.1.2 && <1, phonetic-languages-common >=0.1.1 && <1, ukrainian-phonetics-basic >=0.2 && <1   -- hs-source-dirs:   default-language:    Haskell2010