packages feed

phonetic-languages-simplified-generalized-properties-array 0.5.0.0 → 0.6.0.0

raw patch · 3 files changed

+186/−23 lines, 3 filesdep ~phonetic-languages-rhythmicityPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: phonetic-languages-rhythmicity

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -2,7 +2,7 @@  ## 0.1.0.0 -- 2021-05-04 -* First version. Released on an unsuspecting world. +* First version. Released on an unsuspecting world.  ## 0.1.0.1 -- 2021-05-06 @@ -10,7 +10,7 @@  ## 0.1.0.2 -- 2021-05-07 -* First version revised B. Changed the dependency boundaries of the phonetic-languages-phonetics-basics. +* First version revised B. Changed the dependency boundaries of the phonetic-languages-phonetics-basics.  ## 0.1.1.0 -- 2021-05-10 @@ -26,7 +26,7 @@  ## 0.3.0.0 -- 2021-07-21 -* Third version. Added the "w" and "x" lines support to the properties. +* Third version. Added the "w" and "x" lines support to the properties.  ## 0.4.0.0 -- 2021-07-28 @@ -48,3 +48,10 @@  * Fifth version. Changed the behavior for the new recent properties added so that they are now more linearized. Changed the dependency boundaries for the package phonetic-languages-rhythmicity.++## 0.6.0.0 -- 2021-08-14++* Sixth version. Added new properties lines of "C", "N", "W", "X", "Y", "Z" and updated some previous ones to+use the possibilities of the weighted improtance of lines (just some experimental functions at the moment).+Changed the dependency boundaries of phonetic-languages-rhythmicity.+
Phonetic/Languages/Array/General/PropertiesSyllablesG2.hs view
@@ -14,7 +14,7 @@ -- Instead of the vector-related, uses arrays. -- If you use the functionality of the Phonetic.Languages.Array.Ukrainian.PropertiesSyllablesG2 module, -- then import it qualified (or this module) because they have many common data. Is provided as a standalone one--- to reduce dependencies list in general case. +-- to reduce dependencies list in general case.  {-# LANGUAGE CPP, BangPatterns, MultiWayIf #-} @@ -105,11 +105,11 @@  rhythmicityG   :: ([[[PRS]]] -> [[Double]])-- ^ A function that specifies the syllables durations, analogue of the-  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. +  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package.   -> ([[Double]] -> Double) -- ^ Usually some kind of flattening of the double list into a single value.   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String -- ^ Corresponds to the \'0\' symbol delimiter in the @ukrainian-phonetics-basic-array@ package.@@ -119,35 +119,35 @@ rhythmicityG f g wrs ks arr hs us vs xs  | null xs = 0.0  | otherwise = g . f . createSyllablesPL wrs ks arr hs us vs $ xs-{-# INLINE rhythmicityG #-} +{-# INLINE rhythmicityG #-}  -------------------------------------------------------  rhythmicity0i   :: ([[[PRS]]] -> [[Double]]) -- ^ A function that specifies the syllables durations, analogue of the-  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. +  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package.   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String -- ^ Corresponds to the \'0\' symbol delimiter in the @ukrainian-phonetics-basic-array@ package.   -> String -- ^ Corresponds to the \'1\' and \'-\' symbol delimiters in the @ukrainian-phonetics-basic-array@ package.   -> String   -> Double-rhythmicity0i f = rhythmicityG f eval23 +rhythmicity0i f = rhythmicityG f eval23 {-# INLINE rhythmicity0i #-}  -------------------------------------------------------  rhythmicityKi   :: ([[[PRS]]] -> [[Double]]) -- ^ A function that specifies the syllables durations, analogue of the-  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. +  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package.   -> Double   -> Double   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String -- ^ Corresponds to the \'0\' symbol delimiter in the @ukrainian-phonetics-basic-array@ package.@@ -161,11 +161,11 @@  rhythmicity0Fi   :: ([[[PRS]]] -> [[Double]]) -- ^ A function that specifies the syllables durations, analogue of the-  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. +  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package.   -> Double   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String -- ^ Corresponds to the \'0\' symbol delimiter in the @ukrainian-phonetics-basic-array@ package.@@ -179,13 +179,13 @@  rhythmicityKFi   :: ([[[PRS]]] -> [[Double]]) -- ^ A function that specifies the syllables durations, analogue of the-  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. +  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package.   -> Double   -> Double   -> Double   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String -- ^ Corresponds to the \'0\' symbol delimiter in the @ukrainian-phonetics-basic-array@ package.@@ -199,21 +199,21 @@  -- | It is intended to provide different functions :: 'Double' -> 'String' -> ([[['PRS']]] -> [['Double']]) for at least the -- following values: \"0z\", \"02z\", \"03z\", \"04z\", \"0y\", \"02y\", \"03y\" and the default one for other variants.--- The \"z\"-line uses \'F\' functions. +-- The \"z\"-line uses \'F\' functions. rhythmicity   :: Double   -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\",  -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",  -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since the version 0.3.0.0 you  -- can also use \"w\" or \"x\"-based lines. Specifies the applied properties- -- to get the result. The \"z\"-line uses \'F\' functions. + -- to get the result. The \"z\"-line uses \'F\' functions.   -> (Double -> String -> ([[[PRS]]] -> [[Double]]))-- ^ The function that is needed in the 'procRhythmicity23F' function.  -- Specifies a way how the syllables represented in the phonetic language approach transforms into their durations and  -- depends on two parameters.   -> Coeffs2   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon-  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly. +  -- (e. g. allophones). Must be sorted in the ascending order to be used correctly.   -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.   -> SegmentRulesG   -> String@@ -234,11 +234,53 @@      "x2" -> x0F (Ch 0 1 4) (Rhythm 1 2 1)      "x3" -> x0F (Ch 0 0 4) (Rhythm 1 1 2)      _ -> x0F (Ch 0 0 4) (Rhythm 1 1 2)+ | take 1 choice == "C" = let just_probe = readRhythmicity choice in+           case just_probe of+             Just (P1 ch rh _) -> rhythmicityG f (rhythmicityABC 1.0 2.0 0.125 ch rh . mconcat)+             Just (P2 ch rh r _) -> rhythmicityG f (rhythmicityPolyWeightedF2 1.0 r ch rh . mconcat)+             _ -> rhythmicity0i f+ | take 1 choice == "N" = let just_probe = readRhythmicity choice in+           case just_probe of+             Just (P1 ch rh _) -> rhythmicityG f (rhythmicityABC 1.0 2.0 0.125 ch rh . mconcat)+             Just (P2 ch rh r _) -> rhythmicityG f (rhythmicityPolyWeightedF3 1.0 r ch rh . mconcat)+             _ -> rhythmicity0i f  | take 1 choice == "c" = let just_probe = readRhythmicity choice in            case just_probe of              Just (P1 ch rh _) -> rhythmicityG f (rhythmicityABC 1.0 2.0 0.125 ch rh . mconcat)              Just (P2 ch rh r _) -> rhythmicityG f (rhythmicityPoly 1.0 r ch rh . mconcat)              _ -> rhythmicity0i f+ | take 1 choice == "U" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let uU0F rs = y0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in+               case drop 1 . take 2 $ choice of+                 "0" -> uU0F [True,True,True]+                 "1" -> uU0F [True,True,False]+                 "2" -> uU0F [True,False,True]+                 _ -> uU0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let uU0F rs = y0F (PolyCh rs 5) (PolyRhythm [2,1,1,1]) in+               case drop 1 . take 2 $ choice of+                 "4" -> uU0F [True,True,True]+                 "5" -> uU0F [True,True,False]+                 "6" -> uU0F [True,False,True]+                 ~"7" -> uU0F [True,False,False]+     | otherwise -> rhythmicity0i f+ | take 1 choice == "W" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let wW0F rs = n0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in+               case drop 1 . take 2 $ choice of+                 "0" -> wW0F [True,True,True]+                 "1" -> wW0F [True,True,False]+                 "2" -> wW0F [True,False,True]+                 _ -> wW0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let wW0F rs = n0F (PolyCh rs 5) (PolyRhythm [2,1,1,1]) in+               case drop 1 . take 2 $ choice of+                 "4" -> wW0F [True,True,True]+                 "5" -> wW0F [True,True,False]+                 "6" -> wW0F [True,False,True]+                 ~"7" -> wW0F [True,False,False]+     | otherwise -> rhythmicity0i f  | take 1 choice == "u" = if      | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->          let uu0F rs = u0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in@@ -255,6 +297,38 @@                  "6" -> uu0F [True,False,True]                  ~"7" -> uu0F [True,False,False]      | otherwise -> rhythmicity0i f+ | take 1 choice == "V" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let vV0F rs = z0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in+               case drop 1 . take 2 $ choice of+                 "0" -> vV0F [True,True,True]+                 "1" -> vV0F [True,True,False]+                 "2" -> vV0F [True,False,True]+                 _ -> vV0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let vV0F rs = z0F (PolyCh rs 5) (PolyRhythm [2,1,1,1]) in+               case drop 1 . take 2 $ choice of+                 "4" -> vV0F [True,True,True]+                 "5" -> vV0F [True,True,False]+                 "6" -> vV0F [True,False,True]+                 ~"7" -> vV0F [True,False,False]+     | otherwise -> rhythmicity0i f+ | take 1 choice == "X" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let xX0F rs = s0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in+               case drop 1 . take 2 $ choice of+                 "0" -> xX0F [True,True,True]+                 "1" -> xX0F [True,True,False]+                 "2" -> xX0F [True,False,True]+                 _ -> xX0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let xX0F rs = s0F (PolyCh rs 5) (PolyRhythm [2,1,1,1]) in+               case drop 1 . take 2 $ choice of+                 "4" -> xX0F [True,True,True]+                 "5" -> xX0F [True,True,False]+                 "6" -> xX0F [True,False,True]+                 ~"7" -> xX0F [True,False,False]+     | otherwise -> rhythmicity0i f  | take 1 choice == "v" = if      | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->          let vv0F rs = v0F (PolyCh rs 5) (PolyRhythm [1,2,1,1]) in@@ -271,6 +345,38 @@                  "6" -> vv0F [True,False,True]                  ~"7" -> vv0F [True,False,False]      | otherwise -> rhythmicity0i f+ | take 1 choice == "S" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let sS0F rs = y0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in+               case drop 1 . take 2 $ choice of+                 "0" -> sS0F [True,True,True]+                 "1" -> sS0F [True,True,False]+                 "2" -> sS0F [True,False,True]+                 _ -> sS0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let sS0F rs = y0F (PolyCh rs 6) (PolyRhythm [2,1,1,2]) in+               case drop 1 . take 2 $ choice of+                 "4" -> sS0F [True,True,True]+                 "5" -> sS0F [True,True,False]+                 "6" -> sS0F [True,False,True]+                 ~"7" -> sS0F [True,False,False]+     | otherwise -> rhythmicity0i f+ | take 1 choice == "Y" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let yY0F rs = n0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in+               case drop 1 . take 2 $ choice of+                 "0" -> yY0F [True,True,True]+                 "1" -> yY0F [True,True,False]+                 "2" -> yY0F [True,False,True]+                 _ -> yY0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let yY0F rs = n0F (PolyCh rs 6) (PolyRhythm [2,1,1,2]) in+               case drop 1 . take 2 $ choice of+                 "4" -> yY0F [True,True,True]+                 "5" -> yY0F [True,True,False]+                 "6" -> yY0F [True,False,True]+                 ~"7" -> yY0F [True,False,False]+     | otherwise -> rhythmicity0i f  | take 1 choice == "s" = if      | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->          let ss0F rs = u0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in@@ -287,6 +393,38 @@                  "6" -> ss0F [True,False,True]                  ~"7" -> ss0F [True,False,False]      | otherwise -> rhythmicity0i f+ | take 1 choice == "T" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let tT0F rs = z0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in+               case drop 1 . take 2 $ choice of+                 "0" -> tT0F [True,True,True]+                 "1" -> tT0F [True,True,False]+                 "2" -> tT0F [True,False,True]+                 _ -> tT0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let tT0F rs = z0F (PolyCh rs 6) (PolyRhythm [2,1,1,2]) in+               case drop 1 . take 2 $ choice of+                 "4" -> tT0F [True,True,True]+                 "5" -> tT0F [True,True,False]+                 "6" -> tT0F [True,False,True]+                 ~"7" -> tT0F [True,False,False]+     | otherwise -> rhythmicity0i f+ | take 1 choice == "Z" = if+     | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->+         let zZ0F rs = s0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in+               case drop 1 . take 2 $ choice of+                 "0" -> zZ0F [True,True,True]+                 "1" -> zZ0F [True,True,False]+                 "2" -> zZ0F [True,False,True]+                 _ -> zZ0F [True,False,False]+     | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->+         let zZ0F rs = s0F (PolyCh rs 6) (PolyRhythm [2,1,1,2]) in+               case drop 1 . take 2 $ choice of+                 "4" -> zZ0F [True,True,True]+                 "5" -> zZ0F [True,True,False]+                 "6" -> zZ0F [True,False,True]+                 ~"7" -> zZ0F [True,False,False]+     | otherwise -> rhythmicity0i f  | take 1 choice == "t" = if      | (drop 1 . take 2 $ choice) >= "0" && (drop 1 . take 2 $ choice) <= "3" ->          let tt0F rs = v0F (PolyCh rs 6) (PolyRhythm [1,2,1,2]) in@@ -313,6 +451,14 @@            {-# INLINE x0F #-}            {-# INLINE u0F #-}            {-# INLINE v0F #-}+           y0F ch rh = rhythmicityG f (rhythmicityPolyWeightedF2 1.0 4 ch rh . mconcat)+           z0F ch rh = rhythmicityG f (rhythmicityPolyWeightedF20 1.0 4 ch rh . mconcat)+           {-# INLINE y0F #-}+           {-# INLINE z0F #-}+           n0F ch rh = rhythmicityG f (rhythmicityPolyWeightedF3 1.0 4 ch rh . mconcat)+           s0F ch rh = rhythmicityG f (rhythmicityPolyWeightedF30 1.0 4 ch rh . mconcat)+           {-# INLINE n0F #-}+           {-# INLINE s0F #-} rhythmicity k choice h (CF2 x y)  | choice `elem` ["0z","02z","03z","04z"] = rhythmicityKFi f k (fromMaybe 1.0 x) (fromMaybe 1.0 y)  | take 1 choice == "w" = if@@ -327,6 +473,16 @@    | choice `elem` ["x21","x22","x23","x24"] -> x0F (Ch 0 1 4) (Rhythm 1 2 1)    | choice `elem` ["x31","x32","x33","x34"] -> x0F (Ch 0 0 4) (Rhythm 1 1 2)    | otherwise -> x0F (Ch 1 0 4) (Rhythm 1 1 2)+ | take 1 choice == "C" = rhythmicity k choice h CF0+ | take 1 choice == "U" = rhythmicity k choice h CF0+ | take 1 choice == "V" = rhythmicity k choice h CF0+ | take 1 choice == "S" = rhythmicity k choice h CF0+ | take 1 choice == "T" = rhythmicity k choice h CF0+ | take 1 choice == "N" = rhythmicity k choice h CF0+ | take 1 choice == "W" = rhythmicity k choice h CF0+ | take 1 choice == "X" = rhythmicity k choice h CF0+ | take 1 choice == "Y" = rhythmicity k choice h CF0+ | take 1 choice == "Z" = rhythmicity k choice h CF0  | take 1 choice == "c" = rhythmicity k choice h CF0  | take 1 choice == "u" = rhythmicity k choice h CF0  | take 1 choice == "v" = rhythmicity k choice h CF0@@ -338,4 +494,4 @@            x0F ch rh = rhythmicityG f (rhythmicityABC0 1.0 (fromMaybe 2.0 x) (fromMaybe 0.125 y) ch rh . mconcat)            {-# INLINE w0F #-}            {-# INLINE x0F #-}-           +
phonetic-languages-simplified-generalized-properties-array.cabal view
@@ -3,9 +3,9 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-simplified-generalized-properties-array-version:             0.5.0.0+version:             0.6.0.0 synopsis:            Some 'properties' of the phonetic languages approach text.-description:         Generalizes the functionality of the https://hackage.haskell.org/package/phonetic-languages-simplified-properties-array +description:         Generalizes the functionality of the https://hackage.haskell.org/package/phonetic-languages-simplified-properties-array homepage:            https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array license:             MIT license-file:        LICENSE@@ -21,6 +21,6 @@   exposed-modules:     Phonetic.Languages.Array.General.PropertiesFuncRepG2, Phonetic.Languages.Array.General.PropertiesSyllablesG2   -- other-modules:   other-extensions:    CPP, BangPatterns, MultiWayIf-  build-depends:       base >=4.8 && <4.15, phonetic-languages-simplified-base >=0.2 && <1, phonetic-languages-rhythmicity >=0.6 && <1, phonetic-languages-phonetics-basics >=0.8.1 && <1+  build-depends:       base >=4.8 && <4.15, phonetic-languages-simplified-base >=0.2 && <1, phonetic-languages-rhythmicity >=0.7 && <1, phonetic-languages-phonetics-basics >=0.8.1 && <1   -- hs-source-dirs:   default-language:    Haskell2010