dobutokO-poetry 0.16.2.0 → 0.16.3.0
raw patch · 3 files changed
+20/−12 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- DobutokO.Poetry.Ukrainian.PrepareText: isPronoun :: String -> Bool
+ DobutokO.Poetry.Ukrainian.PrepareText: isPreposition :: String -> Bool
Files
- ChangeLog.md +5/−0
- DobutokO/Poetry/Ukrainian/PrepareText.hs +14/−11
- dobutokO-poetry.cabal +1/−1
ChangeLog.md view
@@ -100,3 +100,8 @@ ## 0.16.2.0 -- 2020-08-24 * Sixteenth version revised B. Fixed an issue with usage of the auxiliary1 function in the DobutokO.Poetry.Ukranian.PrepareText module. ++## 0.16.3.0 -- 2020-08-25++* Sixteenth version revised C. Fixed issues with the isConcatenated and isPreposition functions in the DobutokO.Poetry.Ukranian.PrepareText module. Some documentation +improvements.
DobutokO/Poetry/Ukrainian/PrepareText.hs view
@@ -9,8 +9,8 @@ -- to obtain (to some extent) suitable for poetry or music text. -- In particular, this module can be used to prepare the Ukrainian text -- by applying the most needed grammar to avoid misunderstanding --- for the produced text. The attention is paid to the pronouns, conjunctions --- and particles that are most commonly connected in a significant way +-- for the produced text. The attention is paid to the prepositions, pronouns, conjunctions +-- and particles that are most commonly connected (or not) in a significant way -- with the next text. -- Uses the information from: -- https://uk.wikipedia.org/wiki/%D0%A1%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%BD%D0%B8%D0%BA@@ -105,17 +105,17 @@ auxiliary1 :: [String] -> [String] auxiliary1 (xs:ys:zs:xss) - | isConcatenated ys || isPronoun ys = + | isConcatenated ys || isPreposition ys = auxiliary1 (xs:auxiliary1 ((ys ++ (drop 1 . jottedConv $ ' ':zs)):xss))- | isConcatenated xs || isPronoun xs = auxiliary1 ((xs ++ (drop 1 . jottedConv $ ' ':ys)):zs:xss)+ | isConcatenated xs || isPreposition xs = auxiliary1 ((xs ++ (drop 1 . jottedConv $ ' ':ys)):zs:xss) | otherwise = xs:auxiliary1 (ys:zs:xss) auxiliary1 x@(xs:ys:xss) - | isConcatenated xs || isPronoun xs = auxiliary1 ((xs ++ (drop 1 . jottedConv $ ' ':ys)):xss)+ | isConcatenated xs || isPreposition xs = auxiliary1 ((xs ++ (drop 1 . jottedConv $ ' ':ys)):xss) | otherwise = x auxiliary1 xss = xss -isPronoun :: String -> Bool-isPronoun ts = +isPreposition :: String -> Bool+isPreposition ts = getBFst' (False, V.fromList . zip ["\1030\1079", "\1041\1077\1079", "\1041\1110\1083\1103", "\1042", "\1042\1110\1076", "\1044\1083\1103", "\1044\1086", "\1047", @@ -142,16 +142,19 @@ "\1089\1077\1088\1077\1076\1080", "\1091", "\1095\1077\1088\1077\1079", "\1110\1079"] $ replicate 100 True) ts -{-# INLINE isPronoun #-}+{-# INLINE isPreposition #-} +-- | Since the dobutokO-poetry version 0.16.3.0 the (||) operator has been changed to the (&&). +-- The idea is that these words are the ones that are pronouns and they \"should\" be treated +-- (by the author's understanding) as independent words. isConcatenated :: String -> Bool isConcatenated ts | null ts = False- | otherwise = compare (length ts) 2 /= GT && (getBFst' (True, V.fromList . + | otherwise = compare (length ts) 2 /= GT && getBFst' (True, V.fromList . zip ["\1028", "\1042\1080", "\1052\1080", "\1058\1080", "\1058\1110", "\1062\1110", "\1071", "\1074\1080", "\1084\1080", "\1090\1080", "\1090\1110", - "\1094\1110", "\1103", "\1108"] $ replicate 14 False) ts || - (head ts `notElem` "\1031\1111"))+ "\1094\1110", "\1103", "\1108"] $ replicate 14 False) ts && + (head ts `notElem` "\1031\1111") {-# INLINE isConcatenated #-} concatenated2 :: [String] -> [String]
dobutokO-poetry.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: dobutokO-poetry-version: 0.16.2.0+version: 0.16.3.0 synopsis: Helps to order the 7 or less Ukrainian words to obtain somewhat suitable for poetry or music text description: Helps to order the 7 or less Ukrainian words (or their concatenations) to obtain somewhat suitable for poetry or music text. Can be also used as a research instrument with generalized functions.