phonetic-languages-ukrainian 0.2.3.0 → 0.3.0.0
raw patch · 3 files changed
+19/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Languages.Phonetic.Ukrainian.PrepareText: prepareTextN :: Int -> String -> [String]
+ Languages.Phonetic.Ukrainian.PrepareText: splitLinesN :: Int -> [String] -> [String]
Files
- ChangeLog.md +4/−0
- Languages/Phonetic/Ukrainian/PrepareText.hs +14/−0
- phonetic-languages-ukrainian.cabal +1/−1
ChangeLog.md view
@@ -20,3 +20,7 @@ ## 0.2.3.0 -- 2020-10-06 * Second version revised C. Fixed issues with some functions.++## 0.3.0.0 -- 2020-11-28++* Third version. Added new generalized functions splitLinesN and prepareTextN.
Languages/Phonetic/Ukrainian/PrepareText.hs view
@@ -23,8 +23,10 @@ module Languages.Phonetic.Ukrainian.PrepareText ( -- * Basic functions prepareText+ , prepareTextN , complexWords , splitLines+ , splitLinesN , auxiliary1 , isPreposition , isConcatenated@@ -120,6 +122,18 @@ | null xss = [] | otherwise = mapI (\xs -> compare (length . words $ xs) 7 == GT) (\xs -> let yss = words xs in splitLines . map unwords . (\(q,r) -> [q,r]) . splitAt (length yss `quot` 2) $ yss) $ xss++-- | A generalized variant of the 'splitLines' with the arbitrary maximum number of the words in the lines given as the first argument.+splitLinesN :: Int -> [String] -> [String]+splitLinesN n xss+ | null xss || n <= 0 = []+ | otherwise = mapI (\xs -> compare (length . words $ xs) n == GT) (\xs -> let yss = words xs in+ splitLines . map unwords . (\(q,r) -> [q,r]) . splitAt (length yss `quot` 2) $ yss) $ xss++-- | 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. auxiliary1 . complexWords . words . filter (\t -> isAlpha t || isSpC t)) . filter (not . null) . lines+ auxiliary1 :: [String] -> [String] auxiliary1 (xs:ys:zs:xss)
phonetic-languages-ukrainian.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: phonetic-languages-ukrainian-version: 0.2.3.0+version: 0.3.0.0 synopsis: Prepares Ukrainian text to be used as a phonetic language text description: Prepares Ukrainian text to be used as a phonetic language text. Applies needed minimal grammar connections so that the text afterwards can be processed by dobutokO-poetry related programs homepage: https://hackage.haskell.org/package/phonetic-languages-ukrainian