phonetic-languages-simplified-generalized-examples-common 0.2.1.0 → 0.3.0.0
raw patch · 3 files changed
+39/−8 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Phonetic.Languages.General.Common: fLinesN :: Int -> Concatenations -> String -> String -> String -> Int -> String -> [String]
+ Phonetic.Languages.General.Common: fLinesNIO :: Int -> Concatenations -> String -> String -> String -> String -> IO ()
Files
- ChangeLog.md +5/−1
- Phonetic/Languages/General/Common.hs +33/−6
- phonetic-languages-simplified-generalized-examples-common.cabal +1/−1
ChangeLog.md view
@@ -22,6 +22,10 @@ ## 0.2.1.0 -- 2021-08-31 -* Second version revised A. Some code improvements. Updated the dependency boundaries +* Second version revised A. Some code improvements. Updated the dependency boundaries and removed the subG as a dependency as it is now not needed. +## 0.3.0.0 -- 2021-10-09++* Third version. Added two parameterized functions fLinesN and fLinesNIO that allow also to specify the maximum number of+words in every line.
Phonetic/Languages/General/Common.hs view
@@ -13,7 +13,9 @@ -- module Phonetic.Languages.General.Common (- fLines+ fLinesN+ , fLines+ , fLinesNIO , fLinesIO ) where @@ -21,8 +23,9 @@ import Data.Char (isAlpha) import Data.Monoid (mappend) -fLines- :: Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to+fLinesN+ :: Int+ -> Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to -- leave the most of the meaning (semantics) of the text available to easy understanding while reading and listening to. -> String -> String@@ -30,7 +33,7 @@ -> Int -> String -> [String]-fLines ysss xs us vs !toOneLine ys = filter (any (\x -> isPLL xs x && isAlpha x)) . prepareText ysss xs .+fLinesN n ysss xs us vs !toOneLine ys = filter (any (\x -> isPLL xs x && isAlpha x)) . prepareTextN n ysss xs . (\z -> if toOneLine == 1 then unls z else z) $ ys -- the 'unls' is taken from the 'Data.List.words' and rewritten to be equal to 'unwords' . 'words' where unls s = case dropWhile (`elem` (' ':us `mappend` vs)) s of@@ -38,6 +41,30 @@ s' -> w `mappend` (' ' : unls s'') where (w, s'') = break (`elem` (' ':us `mappend` vs)) s' +fLines+ :: Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to+ -- leave the most of the meaning (semantics) of the text available to easy understanding while reading and listening to.+ -> String+ -> String+ -> String+ -> Int+ -> String+ -> [String]+fLines = fLinesN 7+{-# INLINE fLines #-}++fLinesNIO+ :: Int+ -> Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to+ -- leave the most of the meaning (semantics) of the text available to easy understanding while reading and listening to.+ -> String+ -> String+ -> String+ -> String+ -> IO ()+fLinesNIO n ysss xs us vs ys = mapM_ putStrLn . map (\(i,x) -> show (i + 1) ++ "\t" ++ x) . helpG3 . indexedL "" .+ filter (any (\x -> isPLL xs x && isAlpha x)) . prepareTextN n ysss xs $ ys+ fLinesIO :: Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to -- leave the most of the meaning (semantics) of the text available to easy understanding while reading and listening to.@@ -46,8 +73,8 @@ -> String -> String -> IO ()-fLinesIO ysss xs us vs ys = mapM_ putStrLn . map (\(i,x) -> show (i + 1) ++ "\t" ++ x) . helpG3 . indexedL "" .- filter (any (\x -> isPLL xs x && isAlpha x)) . prepareText ysss xs $ ys+fLinesIO = fLinesNIO 7+{-# INLINE fLinesIO #-} -- | Indexes the 'Foldable' structure using consequential 'Int' values. indexedL :: Foldable t => b -> t b -> [(Int, b)]
phonetic-languages-simplified-generalized-examples-common.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-generalized-examples-common-version: 0.2.1.0+version: 0.3.0.0 synopsis: Some common code for phonetic languages generalized functionality. description: Is intended to be used in the phonetic-languages-simplified-generalized-examples-array package. homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-examples-common