packages feed

ukrainian-phonetics-basic 0.1.11.0 → 0.2.0.0

raw patch · 4 files changed

+36/−12 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Languages.Phonetic.Ukrainian.Syllable: syllableDurations2 :: [[[UZPP2]]] -> [[Float]]
+ Languages.Phonetic.Ukrainian.Syllable: syllableDurationsG :: (UZPP2 -> Float) -> [[[UZPP2]]] -> [[Float]]
+ Languages.Phonetic.Ukrainian.Syllable: uzpp2Durat2 :: UZPP2 -> Float

Files

CHANGELOG.md view
@@ -26,7 +26,7 @@  ## 0.1.6.0 -- 2020-10-28 -* First version revised F. Fixed some issues with palatalization and some combinations that were not properly handled. +* First version revised F. Fixed some issues with palatalization and some combinations that were not properly handled.  ## 0.1.7.0 -- 2020-10-28 @@ -34,7 +34,7 @@  ## 0.1.8.0 -- 2020-11-05 -* First version revised H. Fixed issues with classification functions inside the Melodics.ByteString.Ukrainian module. Changed the dependencies boundaries to +* First version revised H. Fixed issues with classification functions inside the Melodics.ByteString.Ukrainian module. Changed the dependencies boundaries to use the latest improved versions of the packages.  ## 0.1.9.0 -- 2020-11-05@@ -43,12 +43,15 @@  ## 0.1.10.0 -- 2020-11-06 -* First version revised J. Fixed issues with rare complex letter combinations in the Melodics.ByteString.Ukrainian module. The applyChanges uses now strict in the accumulator +* First version revised J. Fixed issues with rare complex letter combinations in the Melodics.ByteString.Ukrainian module. The applyChanges uses now strict in the accumulator version of the foldr -- foldr'.  ## 0.1.11.0 -- 2020-11-06 -* First version revised K. Some code improvements to do it more flexible in the module Melodics.ByteString.Ukrainian. Switched to the lazy version of the foldr in the applyChanges -function.+* First version revised K. Some code improvements to do it more flexible in the module Melodics.ByteString.Ukrainian. Switched to the lazy version of the+foldr in the applyChanges function. +## 0.2.0.0 -- 2020-11-07 +* Second version. Added new variants of the uzpp2Durat1 and syllableDurations functions, obtained from the execution of the pldUkr from the+r-glpk-phonetic-languages-ukrainian-durations package.
Languages/Phonetic/Ukrainian/Syllable.hs view
@@ -5,7 +5,7 @@ -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com ----- This module works with syllable segmentation in Ukrainian. It is rewritten +-- This module works with syllable segmentation in Ukrainian. It is rewritten -- module MMSyn7.Syllable from the @mmsyn7s@ package : https://hackage.haskell.org/package/mmsyn7s -- @@ -104,7 +104,7 @@ isNotVowel2 x y   | phoneType x == W || phoneType y == W = False   | otherwise = True-{-# INLINE isNotVowel2 #-}  +{-# INLINE isNotVowel2 #-}  -- | Binary function-predicate 'notEqC' checks whether its arguments are not the same consonant sound representations (not taking palatalization into account). notEqC :: UZPP2 -> UZPP2 -> Bool@@ -137,7 +137,7 @@       v3       = snd . V.span (\x -> x == '-' || x == '0' || x == '1') $ v2 in v1:vecWords v3  groupSnds :: [UZPP2] -> [[UZPP2]]-groupSnds = L.groupBy (\x y -> ((== W) . phoneType $ x) == ((== W) . phoneType $ y)) +groupSnds = L.groupBy (\x y -> ((== W) . phoneType $ x) == ((== W) . phoneType $ y))  -- | Function 'divCnsnts' is used to divide groups of Ukrainian consonants into two-elements lists that later are made belonging to -- different neighbour syllables if the group is between two vowels in a word. The group must be not empty, but this is not checked.@@ -203,16 +203,38 @@       ("р", 0.049206), ("с", 0.074603), ("сь", 0.074558), ("т", 0.110658), ("у", 0.109070), ("ф", 0.062268), ("х", 0.077188), ("ц", 0.053061),         ("ць", 0.089342), ("ч", 0.057596), ("ш", 0.066077), ("ь", 0.020227), ("і", 0.094150), ("ґ", 0.062948)]) +-- | Just another possible duration approximation obtained by usage of the @r-glpk-phonetic-languages-ukrainian-durations@ package+-- https://hackage.haskell.org/package/r-glpk-phonetic-languages-ukrainian-durations+uzpp2Durat2 :: UZPP2 -> Float+uzpp2Durat2 = X.getBFst' (0.06408817,VB.fromList [(UZ 'A' D, 0.07729654), (UZ 'A' K, 0.07729654), (UZ 'B' D, 0.08048113), (UZ 'B' K, 0.08048113),+  (UZ 'C' S, 0.08226452), (UZ 'D' N, 0.07512999), (UZ 'E' L, 0.12541547), (UZ 'E' M, 0.12541547), (UZ 'F' L, 0.12838476), (UZ 'F' M, 0.12838476),+    (UZ 'a' W, 0.27161466), (UZ 'b' D, 0.10977617), (UZ 'b' K, 0.10977617), (UZ 'c' D, 0.05616409), (UZ 'd' D, 0.06586550), (UZ 'd' K, 0.06586550),+      (UZ 'e' W, 0.27192511), (UZ 'f' L, 0.15776219), (UZ 'f' M, 0.15776219), (UZ 'g' D, 0.07751571), (UZ 'g' K, 0.07751571), (UZ 'h' D, 0.05392745),+        (UZ 'h' K, 0.05392745), (UZ 'i' W, 0.20026538), (UZ 'j' D, 0.08900757), (UZ 'j' K, 0.08900757), (UZ 'k' L, 0.04917820), (UZ 'k' M, 0.04917820),+          (UZ 'l' S, 0.11159399), (UZ 'l' O, 0.11159399), (UZ 'm' S, 0.14303837), (UZ 'm' O, 0.14303837), (UZ 'n' S, 0.05639178),+            (UZ 'n' O, 0.05639178), (UZ 'o' W, 0.28539351), (UZ 'p' L, 0.09603085), (UZ 'p' M, 0.09603085), (UZ 'q' E, 0.02218624), (UZ 'r' S, 0.06354637),+              (UZ 'r' O, 0.06354637), (UZ 's' L, 0.05294375), (UZ 't' L, 0.05047358), (UZ 't' M, 0.05047358), (UZ 'u' W, 0.25250039),+                (UZ 'v' S, 0.08404524), (UZ 'v' O, 0.08404524), (UZ 'w' N, 0.07835033), (UZ 'x' L, 0.07905155), (UZ 'x' M, 0.07905155),+                  (UZ 'y' W, 0.20509350), (UZ 'z' D, 0.06099951), (UZ 'z' K, 0.06099951)])+ uzpp2Durat1 :: UZPP2 -> Float uzpp2Durat1 = X.getBFst' (0.051020, VB.fromList [(UZ 'A' D, 0.055601), (UZ 'A' K, 0.055601), (UZ 'B' D, 0.070658), (UZ 'B' K, 0.070658), (UZ 'C' S, 0.057143), (UZ 'D' N, 0.074558),   (UZ 'E' L, 0.057596), (UZ 'E' M, 0.057596), (UZ 'F' L, 0.066077), (UZ 'F' M, 0.066077), (UZ 'a' W, 0.138231), (UZ 'b' D, 0.057143), (UZ 'b' K, 0.057143), (UZ 'c' D, 0.053061),-   (UZ 'd' D, 0.072063), (UZ 'd' K, 0.072063), (UZ 'e' W, 0.093605), (UZ 'f' L, 0.062268), (UZ 'f' M, 0.062268),  (UZ 'g' D, 0.062948), (UZ 'g' K, 0.062948), (UZ 'h' D, 0.076825), +   (UZ 'd' D, 0.072063), (UZ 'd' K, 0.072063), (UZ 'e' W, 0.093605), (UZ 'f' L, 0.062268), (UZ 'f' M, 0.062268),  (UZ 'g' D, 0.062948), (UZ 'g' K, 0.062948), (UZ 'h' D, 0.076825),     (UZ 'h' K, 0.076825), (UZ 'i' W, 0.094150), (UZ 'j' D, 0.048934), (UZ 'j' K, 0.048934), (UZ 'k' L, 0.045351), (UZ 'k' M, 0.045351), (UZ 'l' S, 0.064036), (UZ 'l' O, 0.064036),      (UZ 'm' S, 0.077370), (UZ 'm' O, 0.077370), (UZ 'n' S, 0.074240), (UZ 'n' O, 0.074240), (UZ 'o' W, 0.116463), (UZ 'p' L, 0.134830), (UZ 'p' M, 0.134830),       (UZ 'q' E, 0.020227), (UZ 'r' S, 0.049206), (UZ 'r' O, 0.049206), (UZ 's' L, 0.074603),  (UZ 't' L, 0.110658), (UZ 't' M, 0.110658), (UZ 'u' W, 0.109070), (UZ 'v' S, 0.082268),        (UZ 'v' O, 0.082268), (UZ 'w' N, 0.089342), (UZ 'x' L, 0.077188), (UZ 'x' M, 0.077188), (UZ 'y' W, 0.099955), (UZ 'z' D, 0.056054), (UZ 'z' K, 0.056054)]) +-- | General variant of the 'syllableDurations' function with the arbitrary 'uzpp2Durat1'-like function.+syllableDurationsG :: (UZPP2 -> Float) -> [[[UZPP2]]] -> [[Float]]+syllableDurationsG g = fmap (fmap (sum . fmap g))+{-# INLINABLE syllableDurationsG #-}+ -- | Returns list of lists, every inner one of which contains approximate durations of the Ukrainian syllables. syllableDurations :: [[[UZPP2]]] -> [[Float]]-syllableDurations = fmap (fmap (sum . fmap (uzpp2Durat1)))+syllableDurations = syllableDurationsG uzpp2Durat1 +-- | Likewise 'syllableDurations', but uses 'uzpp2Durat2' instead of 'uzpp2Durat1'.+syllableDurations2 :: [[[UZPP2]]] -> [[Float]]+syllableDurations2 = syllableDurationsG uzpp2Durat2
Melodics/ByteString/Ukrainian.hs view
@@ -149,7 +149,6 @@                  цT xs, дT xs, фT xs, гT xs, кT xs, пT xs, сT xs, тT xs, цьT xs, хT xs, зT xs]) (fst x):xs           | otherwise = x:xs - isVoicedObstruent :: B.ByteString -> Bool isVoicedObstruent = X.getBFst' (False, VB.fromList [("A",True),("B",True),("Q",True),("R",True),("T",True),("b",True),("d",True),("g",True),("h",True),   ("j",True),("z", True)]) . B.take 1
ukrainian-phonetics-basic.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/  name:                ukrainian-phonetics-basic-version:             0.1.11.0+version:             0.2.0.0 synopsis:            A library to work with the basic Ukrainian phonetics and syllable segmentation. description:         A library to work with the basic Ukrainian phonetics and syllable segmentation. Rewritten from the mmsyn6ukr and mmsyn7s packages. homepage:            https://hackage.haskell.org/package/ukrainian-phonetics-basic