phladiprelio-general-shared 0.1.1.0 → 0.1.2.0
raw patch · 3 files changed
+18/−7 lines, 3 filesdep ~phonetic-languages-phonetics-basicsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: phonetic-languages-phonetics-basics
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- Phladiprelio/General/Parsing.hs +11/−4
- phladiprelio-general-shared.cabal +3/−3
CHANGELOG.md view
@@ -8,3 +8,7 @@ * First version revised A. Updated the dependency boundaries. Added devotion to the README.md. +## 0.1.2.0 -- 2024-01-30++* First version revised B. Updated the dependencies. Inlined many functions for performance reasons.+
Phladiprelio/General/Parsing.hs view
@@ -4,12 +4,12 @@ -- | -- Module : Phladiprelio.General.Parsing--- Copyright : (c) Oleksandr Zhabenko 2021-2023+-- Copyright : (c) Oleksandr Zhabenko 2021-2024 -- License : MIT -- Stability : Experimental -- Maintainer : oleksandr.zhabenko@yahoo.com ----- The additional parsing library functions for the lineVariantsG3 executable.+-- The additional parsing library functions for the PhLADiPreLiO both old and new variants. -- Is taken from the Phonetic.Languages.Parsing module from the -- @phonetic-languages-simplified-examples-array@ package to reduce dependencies in general case. -- @@ -47,6 +47,7 @@ isClosingCurlyBracket :: String -> Bool isClosingCurlyBracket = (== "}")+{-# INLINE isClosingCurlyBracket #-} isSlash :: String -> Bool isSlash (x:xs)@@ -54,14 +55,17 @@ | null xs = True | otherwise = False isSlash _ = False+{-# INLINE isSlash #-} isOpeningCurlyBracket :: String -> Bool isOpeningCurlyBracket = (== "{")+{-# INLINE isOpeningCurlyBracket #-} breakGroupOfStrings :: [String] -> (([String],[[String]]),[String]) breakGroupOfStrings !xss = ((tss,breakInSlashes uss []), drop 1 zss) where (!yss,!zss) = break isClosingCurlyBracket xss (!tss,!uss) = (\(t1,t2) -> (t1,drop 1 t2)) . break isOpeningCurlyBracket $ yss+{-# INLINE breakGroupOfStrings #-} breakInSlashes :: [String] -> [[String]] -> [[String]] breakInSlashes !wss !usss@@ -86,12 +90,13 @@ | otherwise = combineHeadsWithNexts xsss tss where (!y,!tss) = breakGroupOfStrings yss !xsss = combineVariants y+{-# INLINE transformToVariations #-} variations :: [String] -> Bool variations xss | any isSlash xss = if any isOpeningCurlyBracket xss && any isClosingCurlyBracket xss then True else False | otherwise = False-+{-# INLINE variations #-} innerProcessmentSimple :: String -- ^ Must be a valid 'GWritingSystemPRPLX' specifications 'String' representation only (see the gwrsysExample.txt file in the @phonetic-languages-phonetics-basics@ package as a schema);@@ -112,6 +117,7 @@ vs = concat vss ws = sort . concat $ wss in (wrs, ks, arr, gs, js, vs, ysss, zzzsss, ws)+{-# INLINE innerProcessmentSimple #-} {-| -} argsProcessment@@ -122,6 +128,7 @@ -> FilePath -- ^ With the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's). These are to be appended to the previous word. -> IO [String] argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP concatenationsFileA = mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP, concatenationsFileA]+{-# INLINE argsProcessment #-} -- | The function that is mostly intended to be used by the end user. Reads the specifications from -- the5 given files and returns the data that can be used further for generalized PhLADiPreLiO.@@ -134,5 +141,5 @@ -> IO (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, Concatenations, String) readLangSpecs fileGWrSys controlFile segmentRulesFile concatenationsFileP concatenationsFileA = argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP concatenationsFileA >>= \xss -> let [controlConts, gwrsCnts, segmentData, concatenationsFileP1, concatenationsFileA1] = xss in return $ innerProcessmentSimple gwrsCnts controlConts segmentData concatenationsFileP1 concatenationsFileA1 -+{-# INLINE readLangSpecs #-}
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: phladiprelio-general-shared-version: 0.1.1.0+version: 0.1.2.0 -- A short (one-line) description of the package. synopsis: A shared by different general implementations of the PhLADiPreLiO functionality.@@ -9,7 +9,7 @@ description: Is intended to be used by both old phonetic-languages-simplified-generalized-examples-array and new phladiprelio-general-simple packages. -- A URL where users can report bugs.--- bug-reports:+bug-reports: https://github.com/Oleksandr-Zhabenko/phladiprelio-general-shared/issues -- The license under which the package is released. license: MIT@@ -26,7 +26,7 @@ -- LANGUAGE extensions used by modules in this package. other-extensions: BangPatterns, NoImplicitPrelude- build-depends: base >=4.13 && <5, phonetic-languages-phonetics-basics ==0.10.1.0+ build-depends: base >=4.13 && <5, phonetic-languages-phonetics-basics ==0.11.0.0 hs-source-dirs: . default-language: Haskell2010