phonetic-languages-simplified-generalized-examples-common 0.2.0.0 → 0.2.1.0
raw patch · 3 files changed
+17/−17 lines, 3 filesdep −subGdep ~basedep ~phonetic-languages-phonetics-basicsPVP ok
version bump matches the API change (PVP)
Dependencies removed: subG
Dependency ranges changed: base, phonetic-languages-phonetics-basics
API changes (from Hackage documentation)
Files
- ChangeLog.md +6/−0
- Phonetic/Languages/General/Common.hs +9/−15
- phonetic-languages-simplified-generalized-examples-common.cabal +2/−2
ChangeLog.md view
@@ -19,3 +19,9 @@ ## 0.2.0.0 -- 2021-06-04 * Second version. Changed the boundaries for the breaking changes of the phonetic-languages-phonetics-basics package.++## 0.2.1.0 -- 2021-08-31++* Second version revised A. Some code improvements. Updated the dependency boundaries +and removed the subG as a dependency as it is now not needed.+
Phonetic/Languages/General/Common.hs view
@@ -17,7 +17,6 @@ , fLinesIO ) where -import Data.SubG (subG) import Data.Phonetic.Languages.PrepareText import Data.Char (isAlpha) import Data.Monoid (mappend)@@ -31,16 +30,13 @@ -> Int -> String -> [String]-fLines ysss xs us vs !toOneLine ys =- let preText = filter (any (\x -> isPLL xs x && isAlpha x)) . prepareText ysss xs .- (\z -> if toOneLine == 1 then unwords . words $ z else z) $ ys- wss = map (length . subG (' ':us `mappend` vs)) preText- in helpG2 us vs preText wss--helpG2 us vs (t:ts) (r:rs)- | r > 7 = filter (`notElem` (us `mappend` vs)) t:helpG2 us vs ts rs- | otherwise = t:helpG2 us vs ts rs-helpG2 _ _ _ _ = []+fLines ysss xs us vs !toOneLine ys = filter (any (\x -> isPLL xs x && isAlpha x)) . prepareText 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+ "" -> []+ s' -> w `mappend` (' ' : unls s'')+ where (w, s'') = break (`elem` (' ':us `mappend` vs)) s' fLinesIO :: Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to@@ -50,10 +46,8 @@ -> String -> String -> IO ()-fLinesIO ysss xs us vs ys =- let preText = filter (any (\x -> isPLL xs x && isAlpha x)) . prepareText ysss xs $ ys- wss = map (length . subG (' ':us `mappend` vs)) preText- in mapM_ putStrLn . map (\(i,x) -> show (i + 1) ++ "\t" ++ x) . helpG3 . indexedL "" . helpG2 us vs preText $ wss+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 -- | 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.0.0+version: 0.2.1.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@@ -21,6 +21,6 @@ exposed-modules: Phonetic.Languages.General.SimpleConstraints, Phonetic.Languages.General.Common, Phonetic.Languages.General.DeEnCoding -- other-modules: other-extensions: BangPatterns, FlexibleContexts- build-depends: base >=4.8 && <4.15, subG >=0.4.2 && <1, phonetic-languages-phonetics-basics >=0.7 && <1, heaps >=0.3.6.1 && <1+ build-depends: base >=4.8 && <4.16, phonetic-languages-phonetics-basics >=0.8.3 && <1, heaps >=0.3.6.1 && <1 -- hs-source-dirs: default-language: Haskell2010