phonetic-languages-ukrainian-array 0.10.0.0 → 0.11.0.0
raw patch · 4 files changed
+75/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Phladiprelio.Ukrainian.PrepareText: prepareGrowTextMNG :: (Char -> Bool) -> Int -> Int -> String -> [String]
+ Phladiprelio.Ukrainian.PrepareText: prepareTextN2 :: Int -> String -> [String]
+ Phladiprelio.Ukrainian.PrepareText: prepareTextNG :: (Char -> Bool) -> Int -> String -> [String]
+ Phladiprelio.Ukrainian.PrepareText: prepareTuneTextMNG :: (Char -> Bool) -> Int -> Int -> String -> [String]
Files
- ChangeLog.md +4/−0
- Phladiprelio/Ukrainian/PrepareText.hs +47/−3
- README.md +22/−0
- phonetic-languages-ukrainian-array.cabal +2/−2
ChangeLog.md view
@@ -83,3 +83,7 @@ * Tenth version. Switched to NoImplicitPrelude extension. Updated the metadata and dependencies boundaries. +## 0.11.0.0 -- 2023-10-01++* Eleventh version. Added new generalized functions to prepare text. Added README.md file. +
Phladiprelio/Ukrainian/PrepareText.hs view
@@ -43,10 +43,14 @@ -- * The end-user functions , prepareText , prepareTextN+ , prepareTextN2+ , prepareTextNG , growLinesN , prepareGrowTextMN+ , prepareGrowTextMNG , tuneLinesN , prepareTuneTextMN+ , prepareTuneTextMNG -- * Used to transform after convertToProperUkrainian from mmsyn6ukr package , aux4 ) where@@ -56,7 +60,7 @@ import Data.List import CaseBi.Arr (getBFstLSorted') import Data.List.InnToOut.Basic (mapI)-import Data.Char (isAlpha,toLower)+import Data.Char (isAlpha,toLower,isDigit) import GHC.Arr import GHC.Num ((+)) @@ -174,9 +178,24 @@ -- | A generalized variant of the 'prepareText' with the arbitrary maximum number of the words in the lines given as the first argument. prepareTextN :: Int -> String -> [String]-prepareTextN n = filter (any isUkrainianL) . splitLinesN n .- map (unwords . concatenated2 . participleConc . auxiliary1 . complexWords . words . filter (\t -> isAlpha t || isSpC t)) .+prepareTextN = prepareTextNG (\t -> isAlpha t || isSpC t) +{-# INLINE prepareTextN #-}++-- | A generalized variant of the 'prepareText' with the arbitrary maximum number of the words in the lines given as the first argument.+prepareTextN2 :: Int -> String -> [String]+prepareTextN2 = prepareTextNG (\t -> isAlpha t || isSpC t || t == '_' || isDigit t) +{-# INLINE prepareTextN2 #-}++-- | An even more generalized variant of the 'prepareTextN' with the arbitrary maximum number of the words in the lines given as the second argument and the possibility to provide custom function for filtering.+prepareTextNG + :: (Char -> Bool) -- ^ A predicate to filter the symbols during preparation.+ -> Int + -> String + -> [String]+prepareTextNG f n = filter (any isUkrainianL) . splitLinesN n .+ map (unwords . concatenated2 . participleConc . auxiliary1 . complexWords . words . filter f) . filter (not . null) . lines+{-# INLINABLE prepareTextNG #-} participleConc :: [String] -> [String] participleConc (xs:ys:zs:yss)@@ -352,6 +371,18 @@ prepareGrowTextMN m n = growLinesN m . prepareTextN n {-# INLINE prepareGrowTextMN #-} +{-| @ since 0.11.0.0+The generalized version of the 'prepareGrowTextMN' with additional possibility to provide custom function for symbols filtering inside.+-}+prepareGrowTextMNG+ :: (Char -> Bool) -- ^ A predicate to filter the symbols during preparation.+ -> Int -- ^ A maximum number of the words or their concatenations in the resulting list of 'String's.+ -> Int -- ^ A number of words in every 'String' that the function firstly forms. To have some sense of usage, must be less than the first argument.+ -> String+ -> [String]+prepareGrowTextMNG f m n = growLinesN m . prepareTextNG f n+{-# INLINE prepareGrowTextMNG #-}+ ------------------------------------- {-| @ since 0.6.0.0@@ -378,3 +409,16 @@ -> [String] prepareTuneTextMN m n = tuneLinesN m . prepareTextN n {-# INLINE prepareTuneTextMN #-}++{-| @ since 0.11.0.0+The generalized version of the 'prepareTuneTextMN' with additional possibility to provide custom function for symbols filtering inside.+-}+prepareTuneTextMNG+ :: (Char -> Bool) -- ^ A predicate to filter the symbols during preparation.+ -> Int -- ^ A number of the words or their concatenations in the resulting list of 'String's (except probably the last one).+ -> Int -- ^ A number of words in every 'String' that the function firstly forms. To have some sense of usage, must be less than the first argument.+ -> String+ -> [String]+prepareTuneTextMNG f m n = tuneLinesN m . prepareTextNG f n+{-# INLINE prepareTuneTextMNG #-}+
+ README.md view
@@ -0,0 +1,22 @@+ Devotion+ ========++P.S.: the author would like to devote this project to support the [Foundation Gastrostars](https://gastrostars.nl).++On the 01/10/2023 there are International Music Day and [André's Rieu](https://www.andrerieu.com/en) Birthday. So the version 0.11.0.0 is+additionally devoted to him as well as to the Kok family — [Emma](https://emmakok.nl) and [Enzo](https://enzokok.nl) are amazing and fantastic musicians, Vico+works with PhilZuid, Sophie sings in the classical manner. Nathalie Kok with love to her family and +appreciation for André's Rieu support also celebrates the Day. In Ukraine this day has several +important celebrations — Intercession of the Holy Theotokos (Pokrova), Cossacks' Day, Day of Defenders of Ukraine (especially relevant during the Russian war against Ukraine).++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+using the URL:++[Contact Foundation GASTROSTARS](https://gastrostars.nl/hou-mij-op-de-hoogte)++or ++[Donation Page](https://gastrostars.nl/doneren)+
phonetic-languages-ukrainian-array.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: phonetic-languages-ukrainian-array-version: 0.10.0.0+version: 0.11.0.0 synopsis: Prepares Ukrainian text to be used as a phonetic language text description: Applies needed minimal grammar connections so that the text afterwards can be processed by dobutokO-poetry or phonetic languages approach related programs. Uses arrays instead of vectors. Besides can be used to reverse many of the done concatenations. homepage: https://hackage.haskell.org/package/phonetic-languages-ukrainian-array@@ -13,7 +13,7 @@ copyright: Oleksandr Zhabenko category: Language,Game build-type: Simple-extra-source-files: ChangeLog.md+extra-source-files: ChangeLog.md, README.md cabal-version: >=1.10 library