packages feed

mmsyn7s 0.8.0.0 → 0.9.0.0

raw patch · 3 files changed

+33/−13 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ MMSyn7.Syllable: str2Durat1 :: String -> Float
+ MMSyn7.Syllable: syllableDurations :: [[[UZP]]] -> [[Float]]

Files

CHANGELOG.md view
@@ -76,7 +76,7 @@  ## 0.6.5.1 -- 2020-03-01 -* Sixth version revised F. Improved formatting for the statistics printing for "-s" and "-s2" first command line arguments. +* Sixth version revised F. Improved formatting for the statistics printing for "-s" and "-s2" first command line arguments.  ## 0.6.6.0 -- 2020-03-08 @@ -88,9 +88,13 @@  ## 0.7.0.0 -- 2020-06-24 -* Seventh version. Changed Double to Float in the MMSyn7s module so that the functons can be consistent with new dobutokO packages. Besides, the double precision +* Seventh version. Changed Double to Float in the MMSyn7s module so that the functons can be consistent with new dobutokO packages. Besides, the double precision is not needed and in some cases is meaningless and can potentially (a little bit, however) reduce performance in some cases. Some minor code and documentation improvements.  ## 0.8.0.0 -- 2020-08-16  * Eighth version. Changed the import from MMSyn6Ukr.Show7s module and therefore the mmsyn6ukr dependency bounds.++## 0.9.0.0 -- 2020-10-08++* Ninth version. Added new functions to evaluate syllables durations.
MMSyn7/Syllable.hs view
@@ -5,7 +5,7 @@ -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com ----- A program and a library that show a sorted list of the Ukrainian sounds +-- A program and a library that show a sorted list of the Ukrainian sounds -- representations that can be used by mmsyn7 series of programs. This module -- works with syllable segmentation. --@@ -24,6 +24,7 @@   , takeWordSP   , sylLengthsP   , sylLengthsP2+  , syllableDurations   -- * Used internally   , createSyllables   , divideConsonants@@ -35,6 +36,8 @@   , uzpsToList   , representProlonged   , filterC+  -- ** Dealing with sound representation durations+  , str2Durat1   -- ** Working more with UZP format   , createSyllablesP   , takeWithVP@@ -74,7 +77,7 @@         show (VoicelessP2 xs) = xs         show (Sonorous xs) = xs         show (Voiced xs) = xs-        show (Voiceless xs) = xs  +        show (Voiceless xs) = xs  -- | Function 'vecToUZPs' is used to convert a 'V.Vector' of 'String' representing Ukrainian sounds to a list of 'UZP'. vecToUZPs :: V.Vector String -> [UZP]@@ -89,7 +92,7 @@   | getBFst' (False, V.fromList . zip ["б","г","д","дж","дз","ж","з","ґ"] $ (replicate 8 True)) (V.unsafeHead v) = VoicedP (V.unsafeHead v):vecToUZPs (V.unsafeDrop 2 v)   | otherwise = VoicelessP (V.unsafeHead v):vecToUZPs (V.unsafeDrop 2 v) --- | Function 'sndGroups' converts a Ukrainian word being a list of 'UZP' to the list of phonetically similar (consonants grouped with consonants and each vowel separately) +-- | Function 'sndGroups' converts a Ukrainian word being a list of 'UZP' to the list of phonetically similar (consonants grouped with consonants and each vowel separately) -- sounds representations in 'UZP' format. sndGroups :: [UZP] -> [[UZP]] sndGroups ys@(_:_) = L.groupBy isNotVowel2 ys@@ -142,12 +145,12 @@ filterC p t | isVowel1 t = show t             | otherwise = filter p . show $ t --- | Function 'vecWords' similarly to 'Prelude.words' divides a 'V.Vector' of 'String' into list of them, each element of which is a Ukrainian word (or its part +-- | Function 'vecWords' similarly to 'Prelude.words' divides a 'V.Vector' of 'String' into list of them, each element of which is a Ukrainian word (or its part -- for dashed and hyphenated words or that ones with an apostrophe). vecWords :: V.Vector String -> [V.Vector String] vecWords v | V.null v = []            | V.unsafeHead v == "-" || V.unsafeHead v == "0" || V.unsafeHead v == "1" = vecWords (V.unsafeTail v)-           | otherwise = +           | otherwise =   let (v1, v2) = V.break (\x -> x == "-" || x == "0" || x == "1") v       v3       = snd . V.span (\x -> x == "-" || x == "0" || x == "1") $ v2 in v1:vecWords v3 @@ -242,7 +245,7 @@  -- | Function 'sylLengths' shows number of Ukrainian letters (except 'ь') in the syllables in the text needed to represent a sounding of the text, -- which was previously converted with 'syllablesUkr' function. If the syllable does not contain either sounds "дж" / "дз" or prolonged sounds then this number--- is also a number of sounds in it. +-- is also a number of sounds in it. -- If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words. -- This does not influence the syllable structure and so the poetic characteristics of the text. sylLengths :: [[String]] -> [[Int]]@@ -250,14 +253,14 @@  -- | Function 'sylLengthsP' shows number of 'UZP' in the syllables in the text, -- which was previously converted with 'syllablesUkrP' function. If the syllable does not contain prolonged sounds then this number--- is also a number of sounds in it. +-- is also a number of sounds in it. -- If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words. -- This does not influence the syllable structure and so the poetic characteristics of the text. sylLengthsP :: [[[UZP]]] -> [[Int]] sylLengthsP = fmap (fmap length)  -- | Function 'sylLengthsP2' shows number of sounds in the syllables in the text,--- which was previously converted with 'syllablesUkrP' function. +-- which was previously converted with 'syllablesUkrP' function. -- If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words. -- This does not influence the syllable structure and so the poetic characteristics of the text. sylLengthsP2 :: [[[UZP]]] -> [[Int]]@@ -272,3 +275,16 @@   | not . notEqC x $ y = y:representProlonged xs   | otherwise = x:representProlonged (y:xs) representProlonged xs = xs++-- | Is taken from the DobutokO.Sound.DIS5G6G module from @dobutokO2@ package.+-- See: 'https://hackage.haskell.org/package/dobutokO2-0.43.0.0/docs/DobutokO-Sound-DIS5G6G.html'+str2Durat1 :: String -> Float+str2Durat1 = getBFst' ((-0.153016), V.fromList [("-", (-0.101995)), ("0", (-0.051020)), ("1", (-0.153016)), ("а", 0.138231), ("б", 0.057143),+  ("в", 0.082268), ("г", 0.076825), ("д", 0.072063), ("дж", 0.048934), ("дз", 0.055601), ("е", 0.093605), ("ж", 0.070658), ("з", 0.056054),+    ("и", 0.099955), ("й", 0.057143), ("к", 0.045351), ("л", 0.064036), ("м", 0.077370), ("н", 0.074240), ("о", 0.116463), ("п", 0.134830),+      ("р", 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)])++-- | Returns list of lists, every inner one of which contains approximate durations of the Ukrainian syllables.+syllableDurations :: [[[UZP]]] -> [[Float]]+syllableDurations = fmap (fmap (sum . fmap (str2Durat1 . show) . representProlonged))
mmsyn7s.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                mmsyn7s-version:             0.8.0.0+version:             0.9.0.0 synopsis:            Shows a sorted list of the Ukrainian sounds representations that can be used by mmsyn7 series of programs description:         A program and a library that show a sorted list of the Ukrainian sounds representations that can be used by mmsyn7 series of programs homepage:            https://hackage.haskell.org/package/mmsyn7s@@ -19,7 +19,7 @@ library   exposed-modules:     MMSyn7s, Main, MMSyn7.Syllable   -- other-modules:-  -- other-extensions:+  other-extensions:    DeriveDataTypeable   build-depends:       base >=4.7 && <4.15, vector >=0.11 && <0.14, mmsyn6ukr >=0.8 && <1, mmsyn2 >=0.1.8 && < 1, mmsyn5 >=0.4.4  && < 1   -- hs-source-dirs:   default-language:    Haskell2010@@ -28,7 +28,7 @@ executable mmsyn7s   main-is:             Main.hs   other-modules:       MMSyn7.Syllable, MMSyn7s-  -- other-extensions:+  other-extensions:    DeriveDataTypeable   build-depends:       base >=4.7 && <4.15, vector >=0.11 && <0.14, mmsyn6ukr >=0.8 && <1, mmsyn2 >=0.1.8 && < 1, mmsyn5 >=0.4.4  && < 1   -- hs-source-dirs:   default-language:    Haskell2010