phladiprelio-ukrainian-shared 0.1.1.0 → 0.5.0.0
raw patch · 4 files changed
+22/−20 lines, 4 filesdep +phladiprelio-general-datatypedep ~ukrainian-phonetics-basic-arrayPVP ok
version bump matches the API change (PVP)
Dependencies added: phladiprelio-general-datatype
Dependency ranges changed: ukrainian-phonetics-basic-array
API changes (from Hackage documentation)
- Phladiprelio.Ukrainian.ReadDurations: readSound8ToDouble :: String -> (Double, [(Sound8, Double)])
+ Phladiprelio.Ukrainian.ReadDurations: readSound8ToWord8 :: String -> (Word8, [(Sound8, Word8)])
- Phladiprelio.Ukrainian.ReadDurations: readSyllableDurations :: FilePath -> IO [[[[Sound8]]] -> [[Double]]]
+ Phladiprelio.Ukrainian.ReadDurations: readSyllableDurations :: FilePath -> IO [[[[Sound8]]] -> [[Word8]]]
Files
- CHANGELOG.md +4/−0
- Phladiprelio/Ukrainian/ReadDurations.hs +12/−18
- README.md +4/−0
- phladiprelio-ukrainian-shared.cabal +2/−2
CHANGELOG.md view
@@ -8,3 +8,7 @@ * First version revised A. Updated the dependency boundaries. Updated README.md file with devotion. Added Git repository with bug-tracker. +## 0.5.0.0 -- 2024-04-07++* Fifth version. Switched to Word8 instead of Double. Updated the depenencies, added phladiprelio-general-datatype to support changes. Made a version window to provide only subtle updates for the versions smaller than 0.5.0.0.+
Phladiprelio/Ukrainian/ReadDurations.hs view
@@ -13,7 +13,7 @@ import GHC.Base import CaseBi.Arr (getBFstLSorted')-import Phladiprelio.Ukrainian.SyllableDouble+import Phladiprelio.Ukrainian.SyllableWord8 import Text.Read (readMaybe) import Data.Maybe import System.IO@@ -21,7 +21,8 @@ import Data.List (unlines,lines) import System.Directory (doesFileExist) import Phladiprelio.Ukrainian.Melodics-+import GHC.Word+import Phladiprelio.General.Datatype3 (zippedDouble2Word8) {-| For more information on implementation, please refer to the link: @@ -35,27 +36,20 @@ {-| -The first number is the default value that corresponds usually to the word gap duration (and here is not important).-The next 52 'Double' numbers become the durations of the above specified 'Sound8' values respectively, the order+Since the version 0.5.0.0 the semantics changed. Now, there is no duration for the pause between words. +The 52 'Double' numbers become the durations of the above specified 'Sound8' values respectively, the order must be preserved (if you consider it important, well, it should be!). If some number in the file cannot be read as a 'Double' number the function uses the first one that can be instead (the default value). If no such is specified-at all, then the default number is 1.0 for all the 'Sound8' sound representations that is hardly correct.+at all, then the default number is 5 for all the 'Sound8' sound representations. -}-readSound8ToDouble :: String -> (Double,[(Sound8, Double)])-readSound8ToDouble xs- | null xs = (1.0,zip sound8s . replicate 10000 $ 1.0)+readSound8ToWord8 :: String -> (Word8,[(Sound8, Word8)])+readSound8ToWord8 xs+ | null xs = (5,zip sound8s . replicate 10000 $ 5) | otherwise = let wws = lines xs dbls = map (\ks -> readMaybe ks::Maybe Double) wws- dbH- | null dbls || all isNothing dbls = 1.0- | otherwise = fromJust . head . filter isJust $ dbls- dbSs = map (fromMaybe dbH) dbls- (firstD,lsts)- | null dbls = (1.0,zip sound8s . replicate 10000 $ 1.0)- | otherwise = (dbH,zip sound8s (dbSs `mappend` replicate 10000 1.0))- in (firstD,lsts)+ dbSs = map (fromMaybe 5) dbls in (5,zippedDouble2Word8 . zip sound8s $ dbSs `mappend` replicate 10000 1.0) divide2SDDs :: String -> [String] divide2SDDs ys@@ -65,13 +59,13 @@ (kss,tss) = break (any (=='*')) wwss rss = dropWhile (any (== '*')) tss -readSyllableDurations :: FilePath -> IO [[[[Sound8]]] -> [[Double]]]+readSyllableDurations :: FilePath -> IO [[[[Sound8]]] -> [[Word8]]] readSyllableDurations file = do exists <- doesFileExist file if exists then do xs <- readFile file let yss = take 9 . divide2SDDs $ xs- readData = map readSound8ToDouble yss+ readData = map readSound8ToWord8 yss return . map (\(d,zs) -> syllableDurationsGDc (getBFstLSorted' d zs)) $ readData else return []
README.md view
@@ -8,6 +8,10 @@ On the 21/02/2024 there is an International Mother Tongue Day — that is Ukrainian for the author of the package. +On the 12/03/2024 there was a Birthday of Emma Kok, the foundation founder. She turned 16. Therefore, the release 0.5.0.0 is additionally devoted i.e. tributed to her.++Besides, you can support Ukrainian people in various forms.+ All support is welcome, including donations for the needs of the Ukrainian army, IDPs and refugees. If you would like to share some financial support with the Foundation Gastrostars, please, contact the mentioned foundation
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: phladiprelio-ukrainian-shared-version: 0.1.1.0+version: 0.5.0.0 -- A short (one-line) description of the package. synopsis: A shared by different Ukrainian implementations of the PhLADiPreLiO functionality.@@ -26,7 +26,7 @@ -- LANGUAGE extensions used by modules in this package. other-extensions: BangPatterns, NoImplicitPrelude- build-depends: base >=4.13 && <5, directory >=1.3.4.0 && <2, ukrainian-phonetics-basic-array ==0.7.1.1, mmsyn2-array ==0.3.1.1+ build-depends: base >=4.13 && <5, directory >=1.3.4.0 && <2, ukrainian-phonetics-basic-array ==0.10.0.0, phladiprelio-general-datatype ==0.10.0.0, mmsyn2-array ==0.3.1.1 hs-source-dirs: . default-language: Haskell2010