phonetic-languages-simplified-generalized-properties-array 0.6.0.0 → 0.7.0.0
raw patch · 3 files changed
+40/−228 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 +4/−0
- Phonetic/Languages/Array/General/PropertiesSyllablesG2.hs +34/−226
- phonetic-languages-simplified-generalized-properties-array.cabal +2/−2
ChangeLog.md view
@@ -55,3 +55,7 @@ use the possibilities of the weighted improtance of lines (just some experimental functions at the moment). Changed the dependency boundaries of phonetic-languages-rhythmicity. +## 0.7.0.0 -- 2021-08-16++* Seventh version. Some code improvements. Added also the properties with weighted functions that try to increase+the importance of the line ending and to decrease the importance of the beginnings.
Phonetic/Languages/Array/General/PropertiesSyllablesG2.hs view
@@ -234,231 +234,33 @@ "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+ | take 1 choice `elem` ["c","B","C","M","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 (rhythmicityPoly 1.0 r ch rh . mconcat)+ Just (P2 ch rh r _) -> rhythmicityG f ((helperF5 (take 1 choice)) 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- 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 = u0F (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 == "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- 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 = v0F (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 == "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- 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 = u0F (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 == "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+ | (take 1 choice >= "s" && take 1 choice <= "v") || (take 1 choice >= "I" && take 1 choice <= "Z") = 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+ let u0F rs = rhythmicityG f ((helperF6 (take 1 choice)) 1.0 4 (PolyCh rs 5) (PolyRhythm [1,2,1,1]) . mconcat) 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]+ "0" -> u0F [True,True,True]+ "1" -> u0F [True,True,False]+ "2" -> u0F [True,False,True]+ _ -> u0F [True,False,False] | (drop 1 . take 2 $ choice) >= "4" && (drop 1 . take 2 $ choice) <= "7" ->- let tt0F rs = v0F (PolyCh rs 6) (PolyRhythm [2,1,1,2]) in+ let u0F rs = rhythmicityG f ((helperF6 (take 1 choice)) 1.0 4 (PolyCh rs 5) (PolyRhythm [2,1,1,1]) . mconcat) 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]+ "4" -> u0F [True,True,True]+ "5" -> u0F [True,True,False]+ "6" -> u0F [True,False,True]+ ~"7" -> u0F [True,False,False] | otherwise -> rhythmicity0i f | otherwise = rhythmicity0i f where f = h k choice w0F ch rh = rhythmicityG f (rhythmicityABC 1.0 2.0 0.125 ch rh . mconcat) x0F ch rh = rhythmicityG f (rhythmicityABC0 1.0 2.0 0.125 ch rh . mconcat)- u0F ch rh = rhythmicityG f (rhythmicityPoly 1.0 4 ch rh . mconcat)- v0F ch rh = rhythmicityG f (rhythmicityPoly0 1.0 4 ch rh . mconcat) {-# INLINE w0F #-} {-# 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@@ -473,21 +275,8 @@ | 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- | take 1 choice == "s" = rhythmicity k choice h CF0- | take 1 choice == "t" = rhythmicity k choice h CF0+ | (take 1 choice `elem` ["c","B","C"]) || (take 1 choice >= "I" && take 1 choice <= "Z") = rhythmicity k choice h CF0+ | take 1 choice >= "u" && take 1 choice <= "t" = rhythmicity k choice h CF0 | otherwise = rhythmicityKi f (fromMaybe 1.0 x) (fromMaybe 1.0 y) where f = h k choice w0F ch rh = rhythmicityG f (rhythmicityABC 1.0 (fromMaybe 2.0 x) (fromMaybe 0.125 y) ch rh . mconcat)@@ -495,3 +284,22 @@ {-# INLINE w0F #-} {-# INLINE x0F #-} +helperF5 xs+ | xs == "B" = rhythmicityPolyWeightedEF2+ | xs == "C" = rhythmicityPolyWeightedF2+ | xs == "M" = rhythmicityPolyWeightedEF3+ | xs == "N" = rhythmicityPolyWeightedF3+ | otherwise = rhythmicityPoly++helperF6 xs+ | xs == "s" || xs == "u" = rhythmicityPoly+ | xs == "t" || xs == "v" = rhythmicityPoly0+ | xs == "S" || xs == "U" = rhythmicityPolyWeightedF2+ | xs == "T" || xs == "V" = rhythmicityPolyWeightedF20+ | xs == "Y" || xs == "W" = rhythmicityPolyWeightedF3+ | xs == "X" || xs == "Z" = rhythmicityPolyWeightedF30+ | xs == "O" || xs == "Q" = rhythmicityPolyWeightedEF2+ | xs == "P" || xs == "R" = rhythmicityPolyWeightedEF20+ | xs == "I" || xs == "K" = rhythmicityPolyWeightedEF3+ | xs == "J" || xs == "L" = rhythmicityPolyWeightedEF30+ | otherwise = rhythmicityPoly
phonetic-languages-simplified-generalized-properties-array.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-generalized-properties-array-version: 0.6.0.0+version: 0.7.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 homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array@@ -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.7 && <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.8 && <1, phonetic-languages-phonetics-basics >=0.8.1 && <1 -- hs-source-dirs: default-language: Haskell2010