packages feed

aftovolio 0.6.1.0 → 0.6.2.0

raw patch · 8 files changed

+202/−189 lines, 8 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Aftovolio.General.Syllables: instance Aftovolio.General.Syllables.DListRepresentation Aftovolio.General.Syllables.PRS GHC.Int.Int8
- Aftovolio.General.Syllables: instance Aftovolio.General.Syllables.Eval2Bool (Aftovolio.General.Syllables.SegmentationPredFData Aftovolio.General.Syllables.PRS (GHC.Types.Char, GHC.Types.Char))
+ Aftovolio.General.Syllables: instance Aftovolio.General.Syllables.DListRepresentation Aftovolio.General.Syllables.PhoneticPhenomenonRep GHC.Int.Int8
+ Aftovolio.General.Syllables: instance Aftovolio.General.Syllables.Eval2Bool (Aftovolio.General.Syllables.SegmentationPredFData Aftovolio.General.Syllables.PhoneticPhenomenonRep (GHC.Types.Char, GHC.Types.Char))
+ Aftovolio.General.Syllables: type AdditionalDelimiters = String
+ Aftovolio.General.Syllables: type BasicSpaces = String
+ Aftovolio.General.Syllables: type PhoneticPhenomenonRep = PRS
- Aftovolio.General.Simple: argsProcessing :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Word8]]) -> [[String]] -> [[String]] -> String -> IO (Int, Int, Compards, Bool, Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String])
+ Aftovolio.General.Simple: argsProcessing :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> BasicSpaces -> AdditionalDelimiters -> ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) -> [[String]] -> [[String]] -> String -> IO (Int, Int, Compards, Bool, Bool, FilePath, String, String, String, Int, Bool, Int8, FilePath, Int, Bool, String, [String])
- Aftovolio.General.Simple: countSyll :: GWritingSystemPRPLX -> CharPhoneticClassification -> String -> String -> String -> Int
+ Aftovolio.General.Simple: countSyll :: GWritingSystemPRPLX -> CharPhoneticClassification -> BasicSpaces -> AdditionalDelimiters -> String -> Int
- Aftovolio.General.Simple: generalF :: Int -> Int -> Compards -> Bool -> Bool -> FilePath -> String -> (String -> String) -> (String, String) -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Word8]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Int -> Bool -> Int8 -> (FilePath, Int) -> Bool -> String -> [String] -> IO [String]
+ Aftovolio.General.Simple: generalF :: Int -> Int -> Compards -> Bool -> Bool -> FilePath -> String -> (String -> String) -> (String, String) -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> BasicSpaces -> AdditionalDelimiters -> ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> Int -> Bool -> Int8 -> (FilePath, Int) -> Bool -> String -> [String] -> IO [String]
- Aftovolio.General.Simple: outputWithFile :: ([[[PRS]]] -> [[Word8]]) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> String -> Compards -> [AftovolioGen] -> Int -> Int8 -> FilePath -> Int -> IO ()
+ Aftovolio.General.Simple: outputWithFile :: ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> BasicSpaces -> AdditionalDelimiters -> String -> Compards -> [AftovolioGen] -> Int -> Int8 -> FilePath -> Int -> IO ()
- Aftovolio.General.Simple: processingF :: (String -> String) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> ([[[PRS]]] -> [[Word8]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> [[String]] -> [[String]] -> Int -> String -> IO ()
+ Aftovolio.General.Simple: processingF :: (String -> String) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> BasicSpaces -> AdditionalDelimiters -> ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) -> Int -> HashCorrections -> (Int8, [Int8]) -> [[String]] -> [[String]] -> Int -> String -> IO ()
- Aftovolio.General.Syllables: PF :: (SegmentationInfo1 -> [(Char, Char)] -> [PRS] -> Bool) -> SegmentationPredFunction
+ Aftovolio.General.Syllables: PF :: (SegmentationInfo1 -> [(Char, Char)] -> [PhoneticPhenomenonRep] -> Bool) -> SegmentationPredFunction
- Aftovolio.General.Syllables: createSyllablesPL :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> String -> [[[PRS]]]
+ Aftovolio.General.Syllables: createSyllablesPL :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> BasicSpaces -> AdditionalDelimiters -> String -> [[[PhoneticPhenomenonRep]]]
- Aftovolio.General.Syllables: createsSyllable :: PRS -> Bool
+ Aftovolio.General.Syllables: createsSyllable :: PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: divCnsnts :: [(Char, Char)] -> SegmentRulesG -> [PRS] -> DListFunctionResult
+ Aftovolio.General.Syllables: divCnsnts :: [(Char, Char)] -> SegmentRulesG -> [PhoneticPhenomenonRep] -> DListFunctionResult
- Aftovolio.General.Syllables: divSylls :: [[PRS]] -> [[PRS]]
+ Aftovolio.General.Syllables: divSylls :: [[PhoneticPhenomenonRep]] -> [[PhoneticPhenomenonRep]]
- Aftovolio.General.Syllables: findC :: Char -> Array Int PRS -> Maybe PRS
+ Aftovolio.General.Syllables: findC :: Char -> Array Int PhoneticPhenomenonRep -> Maybe PhoneticPhenomenonRep
- Aftovolio.General.Syllables: gBF4 :: Ix i => (# Int#, PRS #) -> (# Int#, PRS #) -> Char -> Array i PRS -> Maybe PRS
+ Aftovolio.General.Syllables: gBF4 :: Ix i => (# Int#, PhoneticPhenomenonRep #) -> (# Int#, PhoneticPhenomenonRep #) -> Char -> Array i PhoneticPhenomenonRep -> Maybe PhoneticPhenomenonRep
- Aftovolio.General.Syllables: groupSnds :: [PRS] -> [[PRS]]
+ Aftovolio.General.Syllables: groupSnds :: [PhoneticPhenomenonRep] -> [[PhoneticPhenomenonRep]]
- Aftovolio.General.Syllables: isSonorous1 :: PRS -> Bool
+ Aftovolio.General.Syllables: isSonorous1 :: PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: isVoicedC1 :: PRS -> Bool
+ Aftovolio.General.Syllables: isVoicedC1 :: PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: isVoicelessC1 :: PRS -> Bool
+ Aftovolio.General.Syllables: isVoicelessC1 :: PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: notCreatesSyllable2 :: PRS -> PRS -> Bool
+ Aftovolio.General.Syllables: notCreatesSyllable2 :: PhoneticPhenomenonRep -> PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: notEqC :: [(Char, Char)] -> PRS -> PRS -> Bool
+ Aftovolio.General.Syllables: notEqC :: [(Char, Char)] -> PhoneticPhenomenonRep -> PhoneticPhenomenonRep -> Bool
- Aftovolio.General.Syllables: reSyllableCntnts :: [(Char, Char)] -> SegmentRulesG -> [[PRS]] -> [[PRS]]
+ Aftovolio.General.Syllables: reSyllableCntnts :: [(Char, Char)] -> SegmentRulesG -> [[PhoneticPhenomenonRep]] -> [[PhoneticPhenomenonRep]]
- Aftovolio.General.Syllables: sndGroups :: [PRS] -> [[PRS]]
+ Aftovolio.General.Syllables: sndGroups :: [PhoneticPhenomenonRep] -> [[PhoneticPhenomenonRep]]
- Aftovolio.General.Syllables: type CharPhoneticClassification = Array Int PRS
+ Aftovolio.General.Syllables: type CharPhoneticClassification = Array Int PhoneticPhenomenonRep
- Aftovolio.General.Syllables: type DListFunctionResult = ([PRS] -> [PRS], [PRS] -> [PRS])
+ Aftovolio.General.Syllables: type DListFunctionResult = ([PhoneticPhenomenonRep] -> [PhoneticPhenomenonRep], [PhoneticPhenomenonRep] -> [PhoneticPhenomenonRep])
- Aftovolio.General.Syllables: type SegmentationFDP = SegmentationPredFData PRS (Char, Char)
+ Aftovolio.General.Syllables: type SegmentationFDP = SegmentationPredFData PhoneticPhenomenonRep (Char, Char)
- Aftovolio.General.Syllables: type StringRepresentation = [PRS]
+ Aftovolio.General.Syllables: type StringRepresentation = [PhoneticPhenomenonRep]

Files

Aftovolio/General/PrepareText.hs view
@@ -59,8 +59,8 @@  -- | The lists in the list are sorted in the descending order by the word counts in the inner 'String's. All the 'String's -- in each inner list have the same number of words, and if there is no 'String' with some intermediate number of words (e. g. there--- are 'String's for 4 and 2 words, but there is no one for 3 words 'String's) then such corresponding list is absent (since--- the 0.9.0.0 version). Probably the maximum number of words can be not more than 4, and the minimum number is+-- are 'String's for 4 and 2 words, but there is no one for 3 words 'String's) then such corresponding list is absent. +-- Probably the maximum number of words can be not more than 4, and the minimum number is -- not less than 1, but it depends. The 'String's in the inner lists must be (unlike the inner -- lists themselves) sorted in the ascending order for the data type to work correctly in the functions of the module. type Concatenations = [[String]]@@ -68,7 +68,7 @@ type ConcatenationsArr = [Array Int (String,Bool)]  defaultConversion :: Concatenations -> ConcatenationsArr-defaultConversion ysss = map (f . filter (not . null)) . filter (not . null) $ ysss+defaultConversion concatenations = map (f . filter (not . null)) . filter (not . null) $ concatenations   where f :: [String] -> Array Int (String,Bool)         f yss = let l = length yss in listArray (0,l-1) . zip yss . cycle $ [True] @@ -79,8 +79,8 @@ -- to avoid the misinterpretation and preserve maximum of the semantics for the -- \"phonetic\" language on the phonetic language basis. prepareText-  :: [[String]] -- ^ Is intended to become a valid 'Concatenations'.-  -> [[String]] -- ^ Is intended to become a valid 'Concatenations'.+  :: [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+  -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word.   -> String -- ^ A sorted 'String' of possible characters in the phonetic language representation.   -> String   -> [String]@@ -99,7 +99,7 @@ -----------------------------------------------------  complexWords2 :: ConcatenationsArr -> String -> (String -> String,String)-complexWords2 ysss@(yss:zsss) zs@(r:rs)+complexWords2 concatArrsss@(yss:zsss) zs@(r:rs)  | getBFst' (False, yss) . unwords $ tss = ((uwxs `mappend`), unwords uss)  | otherwise = complexWords2 zsss zs       where y = length . words . fst . unsafeAt yss $ 0@@ -111,15 +111,15 @@ pairCompl (f,xs) = (f [],xs)  splitWords :: ConcatenationsArr -> [String] -> String -> (String,String)-splitWords ysss tss zs +splitWords concatArrsss tss zs    | null . words $ zs = (mconcat tss,[])   | null ws = (\(xss,uss) -> (mconcat (tss `mappend` xss), unwords uss)) . splitAt 1 . words $ zs-  | otherwise = splitWords ysss (tss `mappend` [ws]) us-        where (ws,us) = pairCompl . complexWords2 ysss $ zs +  | otherwise = splitWords concatArrsss (tss `mappend` [ws]) us+        where (ws,us) = pairCompl . complexWords2 concatArrsss $ zs   concatWordsFromLeftToRight :: ConcatenationsArr -> String -> [String]-concatWordsFromLeftToRight ysss zs = let (ws,us) = splitWords ysss [] zs in-  if null us then [ws] else ws : concatWordsFromLeftToRight ysss us+concatWordsFromLeftToRight concatArrsss zs = let (ws,us) = splitWords concatArrsss [] zs in+  if null us then [ws] else ws : concatWordsFromLeftToRight concatArrsss us  ----------------------------------------------------- @@ -136,12 +136,12 @@ -- | A generalized variant of the 'prepareText' with the arbitrary maximum number of the words in the lines given as the first argument. prepareTextN  :: Int -- ^ A maximum number of the words or their concatenations in the resulting list of 'String's.- -> [[String]] -- ^ Is intended to become a valid 'Concatenations'.- -> [[String]] -- ^ Is intended to become a valid 'Concatenations'.+ -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+ -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word.  -> String -- ^ A sorted 'String' of possible characters in the phonetic language representation.  -> String  -> [String]-prepareTextN n ysss zsss xs = filter (any (isPLL xs)) . splitLinesN n . map (left2right .+prepareTextN maxNumWords ysss zsss xs = filter (any (isPLL xs)) . splitLinesN maxNumWords . map (left2right .   concatWordsFromLeftToRight (defaultConversion . sort2Concat . append2prependConv $ zsss) . left2right .   concatWordsFromLeftToRight (defaultConversion . sort2Concat $ ysss)) . filter (not . null) . lines @@ -163,67 +163,63 @@  -- | 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-     splitLinesN n . map unwords . (\(q,r) -> [q,r]) . splitAt (shiftR (length yss) 1) $ yss) $ xss+splitLinesN maxNumWords xss+ | null xss || maxNumWords <= 0 = []+ | otherwise = mapI (\xs -> compare (length . words $ xs) maxNumWords == GT) (\xs -> let yss = words xs in+     splitLinesN maxNumWords . map unwords . (\(q,r) -> [q,r]) . splitAt (shiftR (length yss) 1) $ yss) $ xss  ------------------------------------------------ -{-| @ since 0.8.0.0-Given a positive number and a list tries to rearrange the list's 'String's by concatenation of the several elements of the list+{-| Given a positive number and a list tries to rearrange the list's 'String's by concatenation of the several elements of the list so that the number of words in every new 'String' in the resulting list is not greater than the 'Int' argument. If some of the 'String's have more than that number quantity of the words then these 'String's are preserved. -} growLinesN :: Int -> [String] -> [String]-growLinesN n xss- | null xss || n < 0 = []- | otherwise = unwords yss : growLinesN n zss-     where l = length . takeWhile (<= n) . scanl1 (+) . map (length . words) $ xss -- the maximum number of lines to be taken+growLinesN maxNumWords xss+ | null xss || maxNumWords < 0 = []+ | otherwise = unwords yss : growLinesN maxNumWords zss+     where l = length . takeWhile (<= maxNumWords) . scanl1 (+) . map (length . words) $ xss -- the maximum number of lines to be taken            (yss,zss) = splitAt (max l 1) xss -{-| @ since 0.8.0.0-The function combines the 'prepareTextN' and 'growLinesN' function. Applies needed phonetic language preparations+{-| The function combines the 'prepareTextN' and 'growLinesN' function. Applies needed phonetic language preparations to the text and tries to \'grow\' the resulting 'String's in the list so that the number of the words in every of them is no greater than the given first 'Int' number. -} prepareGrowTextMN  :: 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]] -- ^ Is intended to become a valid 'Concatenations'.- -> [[String]] -- ^ Is intended to become a valid 'Concatenations'.+ -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+ -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word.  -> String -- ^ A sorted 'String' of possible characters in the phonetic language representation.  -> String  -> [String]-prepareGrowTextMN m n ysss zsss xs = growLinesN m . prepareTextN n ysss zsss xs+prepareGrowTextMN maxNumWords firstNumWords ysss zsss xs = growLinesN maxNumWords . prepareTextN firstNumWords ysss zsss xs {-# INLINE prepareGrowTextMN #-}  ------------------------------------- -{-| @ since 0.6.0.0-Recursively splits the concatenated list of lines of words so that in every resulting 'String' in the list+{-| Recursively splits the concatenated list of lines of words so that in every resulting 'String' in the list except the last one there is just 'Int' -- the first argument -- words. -} tuneLinesN :: Int -> [String] -> [String]-tuneLinesN n xss- | null xss || n < 0 = []+tuneLinesN maxNumWords xss+ | null xss || maxNumWords < 0 = []  | otherwise =     let wss = words . unwords $ xss-        (yss,zss) = splitAt n wss-          in unwords yss : tuneLinesN n zss+        (yss,zss) = splitAt maxNumWords wss+          in unwords yss : tuneLinesN maxNumWords zss -{-| @ since 0.6.0.0-The function combines the 'prepareTextN' and 'tuneLinesN' functions. Applies needed phonetic language preparations+{-| The function combines the 'prepareTextN' and 'tuneLinesN' functions. Applies needed phonetic language preparations to the phonetic language text and splits the list of 'String's so that the number of the words in each of them (except the last one) is equal the given first 'Int' number. -} prepareTuneTextMN   :: 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]] -- ^ Is intended to become a valid 'Concatenations'.-  -> [[String]] -- ^ Is intended to become a valid 'Concatenations'.+  -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+  -> [[String]] -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word   -> String -- ^ A sorted 'String' of possible characters in the phonetic language representation.   -> String   -> [String]-prepareTuneTextMN m n ysss zsss xs = tuneLinesN m . prepareTextN n ysss zsss xs+prepareTuneTextMN maxNumWords firstNumWords ysss zsss xs = tuneLinesN maxNumWords . prepareTextN firstNumWords ysss zsss xs {-# INLINE prepareTuneTextMN #-}
Aftovolio/General/Simple.hs view
@@ -96,11 +96,11 @@     CharPhoneticClassification ->     SegmentRulesG ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->-    -- | Since the version 0.20.0.0, here there are 'Word8' instead of 'Double'. If this function is @g@, then the module 'Aftovolio.General.Datatype3' has corresponding function 'Aftovolio.General.Datatype3.zippedDouble2Word8' to transform the previously used function into the new one. If you have the function used inside the @f::[[[PRS]]]->[[Double]]@ with main conversion semantically similar to the one by the link: 'https://hackage.haskell.org/package/ukrainian-phonetics-basic-array-0.7.1.1/docs/Phladiprelio-Ukrainian-SyllableDouble.html#v:syllableDurationsD', then you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PRS, Double)] into [(PRS, Word8)].-    ([[[PRS]]] -> [[Word8]]) ->+    AdditionalDelimiters ->+    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PhoneticPhenomenonRep]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PhoneticPhenomenonRep, Double)] into [(PhoneticPhenomenonRep, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.+    ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) ->     Int ->     HashCorrections ->     (Int8, [Int8]) ->@@ -115,7 +115,7 @@     String ->     [String] ->     IO [String]-generalF power10 ldc compards html filtering dcfile selStr selFun (prestr, poststr) lineNmb wrs ks arr gs us vs h numTest hc (grps, mxms) hashStep emptyline splitting (fs, code) concurrently initstr universalSet+generalF power10 ldc compards html filtering dcfile selStr selFun (prestr, poststr) lineNmb writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims h numTest hc (grps, mxms) hashStep emptyline splitting (fs, code) concurrently initstr universalSet     | L.null universalSet = do         let strOutput =                 [ "You have specified the data and constraints on it that lead to no further possible options."@@ -127,7 +127,7 @@         putStrLn . unlines $ universalSet         return universalSet     | otherwise = do-        let syllN = countSyll wrs arr us vs initstr+        let syllN = countSyll writingSystem arrCharClassification basicSpaces additionalDelims initstr             f ldc compards grps mxms                 | L.null selStr =                     ( if doubleFunc (L.null :: [Word8] -> Bool) (L.null :: [Int8] -> Bool) compards@@ -141,12 +141,12 @@                         . read3                             (not . L.null . filter (not . isSpace))                             1.0-                            (mconcat . h . createSyllablesPL wrs ks arr gs us vs)+                            (mconcat . h . createSyllablesPL writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims)                 | otherwise =                     fromIntegral-                        . diverse2GGL (selectSounds selFun selStr) (us `mappend` vs)+                        . diverse2GGL (selectSounds selFun selStr) (basicSpaces `mappend` additionalDelims)                         . concatMap string1-                        . stringToXG wrs+                        . stringToXG writingSystem                         . filter (\c -> not (isDigit c) && c /= '_' && c /= '=')         hSetNewlineMode stdout universalNewlineMode         if numTest@@ -214,7 +214,7 @@                                     let writ = writable permiss                                         readab = readable permiss                                     if writ && readab-                                        then outputWithFile h wrs ks arr gs us vs selStr compards sRepresent code grps fs num+                                        then outputWithFile h writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims selStr compards sRepresent code grps fs num                                         else                                             error                                                 "The specified file cannot be used for appending the text! Please, specify another file!"@@ -244,20 +244,20 @@     GWritingSystemPRPLX ->     CharPhoneticClassification ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    AdditionalDelimiters ->     String ->     Int-countSyll wrs arr us vs xs =+countSyll writingSystem arrCharClassification basicSpaces additionalDelims xs =     numUnderscoresSyll         + ( fromEnum                 . foldr (\x y -> if createsSyllable x then y + 1 else y) 0-                . concatMap (str2PRSs arr)+                . concatMap (str2PRSs arrCharClassification)                 . words1                 . mapMaybe g                 . concatMap string1-                . stringToXG wrs $+                . stringToXG writingSystem $                 xs           )   where@@ -270,8 +270,8 @@             xs     g :: Char -> Maybe Char     g x-        | x `elem` us = Nothing-        | x `notElem` vs = Just x+        | x `elem` basicSpaces = Nothing+        | x `notElem` additionalDelims = Just x         | otherwise = Just ' '     words1 xs = if L.null ts then [] else w : words1 s'' -- Practically this is an optimized version for this case 'words' function from Prelude.       where@@ -316,13 +316,13 @@     CharPhoneticClassification ->     SegmentRulesG ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->-    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PRS]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PRS, Double)] into [(PRS, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.1.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.-    ([[[PRS]]] -> [[Word8]]) ->-    [[String]] ->-    [[String]] ->+    AdditionalDelimiters ->+    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PhoneticPhenomenonRep]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PhoneticPhenomenonRep, Double)] into [(PhoneticPhenomenonRep, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.+    ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) ->+    [[String]] -> -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+    [[String]] -> -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word     String ->     -- | These ones are intended to be used inside 'generalF'.     IO@@ -344,7 +344,7 @@         , String         , [String]         )-argsProcessing wrs ks arr gs us vs h ysss zsss xs = do+argsProcessing writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims h ysss zsss xs = do     args0 <- getArgs     let (argsC, args) = takeCs1R ('+', '-') cSpecs args0         (argsB, args11) = takeBsR bSpecs args@@ -431,7 +431,7 @@                             . read3                                 (not . L.null . filter (not . isSpace))                                 1.0-                                (mconcat . h . createSyllablesPL wrs ks arr gs us vs) $+                                (mconcat . h . createSyllablesPL writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims) $                             line2comparewith                 (filesave, codesave)                     | L.null filedata = ("", -1)@@ -460,7 +460,7 @@                         . read3                             (not . L.null . filter (not . isSpace))                             1.0-                            (mconcat . h . createSyllablesPL wrs ks arr gs us vs)+                            (mconcat . h . createSyllablesPL writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims)                         . unwords $                         arg3s                 le = doubleFunc (length :: [Word8] -> Int) (length :: [Int8] -> Int) example@@ -506,22 +506,22 @@     CharPhoneticClassification ->     SegmentRulesG ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->-    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PRS]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PRS, Double)] into [(PRS, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.1.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.-    ([[[PRS]]] -> [[Word8]]) ->+    AdditionalDelimiters ->+    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PhoneticPhenomenonRep]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PhoneticPhenomenonRep, Double)] into [(PhoneticPhenomenonRep, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.+    ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) ->     Int ->     HashCorrections ->     (Int8, [Int8]) ->-    [[String]] ->-    [[String]] ->+    [[String]] -> -- ^ Is intended to become a valid 'Concatenations' that are to be prepended to the next word.+    [[String]] -> -- ^ Is intended to become a valid 'Concatenations' that are to be appended to the previous word     -- | The hashing function step. The default value is 20. Is expected to be greater than 2, and better greater than 12.     Int ->     String ->     IO ()-processingF selFun wrs ks arr gs us vs h numTest hc (grps, mxms) ysss zsss hashStep xs =-    argsProcessing wrs ks arr gs us vs h ysss zsss xs >>= \( power10+processingF selFun writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims h numTest hc (grps, mxms) ysss zsss hashStep xs =+    argsProcessing writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims h ysss zsss xs >>= \( power10                                                             , ldc                                                             , compards                                                             , html@@ -550,12 +550,12 @@             selFun             (prestr, poststr)             lineNmb-            wrs-            ks-            arr-            gs-            us-            vs+            writingSystem+            allophones+            arrCharClassification+            segmentRules+            basicSpaces+            additionalDelims             h             numTest             hc@@ -635,8 +635,7 @@                         `mappend` "  -> "                         `mappend` showFFloat (Just 3) (100 * fromIntegral mx / fromIntegral m) "%"                         `mappend` ( if rem numTest 10 >= 4-                                        then -- let min1 = minimumBy (comparing (f ldc [] q qs)) universalSet in-+                                        then                                              ( "\n"                                                 `mappend` (if filtering then removeChangesOfDurations else id) min1                                                 `mappend` "\n"@@ -653,8 +652,8 @@  -- | Internal part of the 'generalF' for processment with a file. outputWithFile ::-    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PRS]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PRS, Double)] into [(PRS, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.1.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.-    ([[[PRS]]] -> [[Word8]]) ->+    -- | See the conversion function 'Aftovolio.General.Datatype3.zippedDouble2Word8'. It is easier to obtain the function @f::[[[PhoneticPhenomenonRep]]]->[[Double]]@, and, afterwards, you can use 'zippedDouble2Word8' to transform the main semantic kernel of [(PhoneticPhenomenonRep, Double)] into [(PhoneticPhenomenonRep, Word8)]. For more information, see 'https://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md' in the section 'Ability to use your own durations of representations of sounds or phonetic phenomena'.+    ([[[PhoneticPhenomenonRep]]] -> [[Word8]]) ->     -- | Data used to obtain the phonetic language representation of the text.     GWritingSystemPRPLX ->     -- | The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon (e. g. allophones). Must be sorted in the ascending order to be used correctly.@@ -662,9 +661,9 @@     CharPhoneticClassification ->     SegmentRulesG ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    AdditionalDelimiters ->     -- | If not null than instead of rhythmicity evaluation using hashes and and feets, there is computed a diversity property for the specified 'String' here using the 'selectSounds' function. For more information, see: 'https://oleksandr-zhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.html#types'     String ->     -- | A value that the different options are compared with. If no command line argument \"+di\" was added, then this is a `C1` applied to the list of positive values normed by 255 (the greatest of which is 255) that the line options are compared with. If null, then the program works without comparison. The length of it must be a least common multiplier of the (number of syllables plus number of \'_digits\' groups) to work correctly. Is not used when the next 'FilePath' and 'String' arguments are not null. If \"+di\" command line argument was  provided, then this corresponds to the case of differentiation.@@ -676,7 +675,7 @@     FilePath ->     Int ->     IO ()-outputWithFile h wrs ks arr gs us vs selStr compards sRepresent code grps fs num+outputWithFile h writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims selStr compards sRepresent code grps fs num     | mBool && code >= 10 && code <= 19 && grps == 2 =         putStrLn (mconcat [textP, "\n", breaks, "\n", show rs])             >> appendF@@ -694,8 +693,8 @@     outputS = outputSel lineOption code     qqs =         readEq4-            (mconcat . h . createSyllablesPL wrs ks arr gs us vs)-            (map (map charS) . mconcat . createSyllablesPL wrs ks arr gs us vs)+            (mconcat . h . createSyllablesPL writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims)+            (map (map charS) . mconcat . createSyllablesPL writingSystem allophones arrCharClassification segmentRules basicSpaces additionalDelims)             . basicSplit $             textP     (breaks, rs) = showZerosFor2PeriodMusic qqs
Aftovolio/General/Syllables.hs view
@@ -16,11 +16,12 @@ Maintainer  :  oleksandr.zhabenko@yahoo.com  This module works with syllable segmentation. The generalized version for the module-'Aftovolio.Ukrainian.Syllable' from @ukrainian-phonetics-basic-array@ package.+'Aftovolio.Ukrainian.Syllable'. -} module Aftovolio.General.Syllables (     -- * Data types and type synonyms     PRS (..),+    PhoneticPhenomenonRep,     PhoneticType (..),     CharPhoneticClassification,     StringRepresentation,@@ -34,6 +35,8 @@     SegmentationRules1 (..),     SegmentRulesG,     DListRepresentation (..),+    BasicSpaces,+    AdditionalDelimiters,      -- * Basic functions     str2PRSs,@@ -77,6 +80,7 @@  -- CAUTION: Please, do not mix with the show7s functions, they are not interoperable. +-- | The AFTOVolio phonetic phenomenon representation.  data PRS = SylS     { charS :: {-# UNPACK #-} !Char     -- ^ Phonetic languages phenomenon representation. Usually, a phoneme, but it can be otherwise something different.@@ -87,6 +91,9 @@     }     deriving (Eq, Read) +-- | Type synonym to be used for clarity and better code readability.+type PhoneticPhenomenonRep = PRS+ instance Ord PRS where     compare (SylS x1 y1) (SylS x2 y2) =         case compare x1 x2 of@@ -105,75 +112,75 @@ fromPhoneticType (P x) = fromEnum x  -- | The 'Array' 'Int' must be sorted in the ascending order to be used in the module correctly.-type CharPhoneticClassification = Array Int PRS+type CharPhoneticClassification = Array Int PhoneticPhenomenonRep  {- | The 'String' of converted phonetic language representation 'Char' data is converted to this type to apply syllable segmentation or other transformations. -}-type StringRepresentation = [PRS]+type StringRepresentation = [PhoneticPhenomenonRep]  -- | Is somewhat rewritten from the 'CaseBi.Arr.gBF3' function (not exported) from the @mmsyn2-array@ package. gBF4 ::     (Ix i) =>-    (# Int#, PRS #) ->-    (# Int#, PRS #) ->+    (# Int#, PhoneticPhenomenonRep #) ->+    (# Int#, PhoneticPhenomenonRep #) ->     Char ->-    Array i PRS ->-    Maybe PRS-gBF4 (# !i#, k #) (# !j#, m #) c arr+    Array i PhoneticPhenomenonRep ->+    Maybe PhoneticPhenomenonRep+gBF4 (# !i#, k #) (# !j#, m #) c arrayCharClassification     | isTrue# ((j# -# i#) ># 1#) =         case compare c (charS p) of-            GT -> gBF4 (# n#, p #) (# j#, m #) c arr-            LT -> gBF4 (# i#, k #) (# n#, p #) c arr+            GT -> gBF4 (# n#, p #) (# j#, m #) c arrayCharClassification+            LT -> gBF4 (# i#, k #) (# n#, p #) c arrayCharClassification             _ -> Just p     | c == charS m = Just m     | c == charS k = Just k     | otherwise = Nothing   where     !n# = (i# +# j#) `quotInt#` 2#-    !p = unsafeAt arr (I# n#)+    !p = unsafeAt arrayCharClassification (I# n#)  findC ::     Char ->-    Array Int PRS ->-    Maybe PRS-findC c arr = gBF4 (# i#, k #) (# j#, m #) c arr+    Array Int PhoneticPhenomenonRep ->+    Maybe PhoneticPhenomenonRep+findC c arrayCharClassification = gBF4 (# i#, k #) (# j#, m #) c arrayCharClassification   where-    !(I# i#, I# j#) = bounds arr-    !k = unsafeAt arr (I# i#)-    !m = unsafeAt arr (I# i#)+    !(I# i#, I# j#) = bounds arrayCharClassification+    !k = unsafeAt arrayCharClassification (I# i#)+    !m = unsafeAt arrayCharClassification (I# i#) {-# INLINE findC #-}  str2PRSs :: CharPhoneticClassification -> String -> StringRepresentation-str2PRSs arr = map (\c -> fromJust . findC c $ arr)+str2PRSs arrayCharClassification = map (\c -> fromJust . findC c $ arrayCharClassification) {-# INLINE str2PRSs #-}  {- | Function-predicate 'createsSyllable' checks whether its argument is a phoneme representation that-every time being presented in the text leads to the creation of the new syllable (in the 'PRS' format).+every time being presented in the text leads to the creation of the new syllable (in the 'PhoneticPhenomenonRep' format). Usually it is a vowel, but in some languages there can be syllabic phonemes that are not considered to be vowels. -}-createsSyllable :: PRS -> Bool+createsSyllable :: PhoneticPhenomenonRep -> Bool createsSyllable = (== P 0) . phoneType {-# INLINE createsSyllable #-} --- | Function-predicate 'isSonorous1' checks whether its argument is a sonorous consonant representation in the 'PRS' format.-isSonorous1 :: PRS -> Bool+-- | Function-predicate 'isSonorous1' checks whether its argument is a sonorous consonant representation in the 'PhoneticPhenomenonRep' format.+isSonorous1 :: PhoneticPhenomenonRep -> Bool isSonorous1 = (`elem` [1, 2]) . fromPhoneticType . phoneType {-# INLINE isSonorous1 #-} --- | Function-predicate 'isVoicedC1' checks whether its argument is a voiced consonant representation in the 'PRS' format.-isVoicedC1 :: PRS -> Bool+-- | Function-predicate 'isVoicedC1' checks whether its argument is a voiced consonant representation in the 'PhoneticPhenomenonRep' format.+isVoicedC1 :: PhoneticPhenomenonRep -> Bool isVoicedC1 = (`elem` [3, 4]) . fromPhoneticType . phoneType {-# INLINE isVoicedC1 #-} --- | Function-predicate 'isVoiceless1' checks whether its argument is a voiceless consonant representation in the 'PRS' format.-isVoicelessC1 :: PRS -> Bool+-- | Function-predicate 'isVoiceless1' checks whether its argument is a voiceless consonant representation in the 'PhoneticPhenomenonRep' format.+isVoicelessC1 :: PhoneticPhenomenonRep -> Bool isVoicelessC1 = (`elem` [5, 6]) . fromPhoneticType . phoneType {-# INLINE isVoicelessC1 #-} --- | Binary function-predicate 'notCreatesSyllable2' checks whether its arguments are both consonant representations in the 'PRS' format.-notCreatesSyllable2 :: PRS -> PRS -> Bool+-- | Binary function-predicate 'notCreatesSyllable2' checks whether its arguments are both consonant representations in the 'PhoneticPhenomenonRep' format.+notCreatesSyllable2 :: PhoneticPhenomenonRep -> PhoneticPhenomenonRep -> Bool notCreatesSyllable2 x y     | phoneType x == P 0 || phoneType y == P 0 = False     | otherwise = True@@ -183,8 +190,8 @@ notEqC ::     -- | The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon (e. g. allophones). Must be sorted in the ascending order to be used correctly.     [(Char, Char)] ->-    PRS ->-    PRS ->+    PhoneticPhenomenonRep ->+    PhoneticPhenomenonRep ->     Bool notEqC xs x y     | (== cy) . getBFstLSorted' cx xs $ cx = False@@ -194,15 +201,15 @@     !cy = charS y {-# INLINE notEqC #-} -{- | Function 'sndGroups' converts a word being a list of 'PRS' to the list of phonetically similar (consonants grouped with consonants and each vowel separately)-sounds representations in 'PRS' format.+{- | Function 'sndGroups' converts a word being a list of 'PhoneticPhenomenonRep' to the list of phonetically similar (consonants grouped with consonants and each vowel separately)+sounds representations in 'PhoneticPhenomenonRep' format. -}-sndGroups :: [PRS] -> [[PRS]]+sndGroups :: [PhoneticPhenomenonRep] -> [[PhoneticPhenomenonRep]] sndGroups ys@(_ : _) = L.groupBy notCreatesSyllable2 ys sndGroups _ = [] {-# INLINE sndGroups #-} -groupSnds :: [PRS] -> [[PRS]]+groupSnds :: [PhoneticPhenomenonRep] -> [[PhoneticPhenomenonRep]] groupSnds = L.groupBy (\x y -> createsSyllable x == createsSyllable y) {-# INLINE groupSnds #-} @@ -230,7 +237,7 @@                     _ -> Nothing  {- | We can think of 'SegmentationPredFunction' in terms of @f ('SI' fN pN) ks [x_{1},x_{2},...,x_{i},...,x_{fN}]@. Comparing with-'divCnsnts' from the @ukrainian-phonetics-basics-array@ we can postulate that it consists of the following logical terms in+'divCnsnts' from the 'Aftovolio.Ukrainian.Syllable' we can postulate that it consists of the following logical terms in the symbolic form:  1) 'phoneType' x_{i} \`'elem'\` (X{...} = 'map' 'P' ['Int8'])@@ -244,7 +251,7 @@ we can further represent the function by the following data type and operations with it, see 'SegmentationPredFData'. -} data SegmentationPredFunction-    = PF (SegmentationInfo1 -> [(Char, Char)] -> [PRS] -> Bool)+    = PF (SegmentationInfo1 -> [(Char, Char)] -> [PhoneticPhenomenonRep] -> Bool)  data SegmentationPredFData a b     = L Int [Int] (Array Int a)@@ -256,34 +263,34 @@ class Eval2Bool a where     eval2Bool :: a -> Bool -type SegmentationFDP = SegmentationPredFData PRS (Char, Char)+type SegmentationFDP = SegmentationPredFData PhoneticPhenomenonRep (Char, Char) -instance Eval2Bool (SegmentationPredFData PRS (Char, Char)) where-    eval2Bool (L i js arr)+instance Eval2Bool (SegmentationPredFData PhoneticPhenomenonRep (Char, Char)) where+    eval2Bool (L i js arrayCharClassification)         | all (<= n) js && i <= n && i >= 1 && all (>= 1) js =-            fromPhoneticType (phoneType (unsafeAt arr $ i - 1)) `elem` js+            fromPhoneticType (phoneType (unsafeAt arrayCharClassification $ i - 1)) `elem` js         | otherwise =             error                 "Aftovolio.General.Syllables.eval2Bool: 'L' element is not properly defined. "       where-        n = numElements arr-    eval2Bool (NEC i j arr ks)+        n = numElements arrayCharClassification+    eval2Bool (NEC i j arrayCharClassification allophones)         | i >= 1 && j >= 1 && i /= j && i <= n && j <= n =-            notEqC ks (unsafeAt arr $ i - 1) (unsafeAt arr $ j - 1)+            notEqC allophones (unsafeAt arrayCharClassification $ i - 1) (unsafeAt arrayCharClassification $ j - 1)         | otherwise =             error                 "Aftovolio.General.Syllables.eval2Bool: 'NEC' element is not properly defined. "       where-        n = numElements arr+        n = numElements arrayCharClassification     eval2Bool (C x y) = eval2Bool x && eval2Bool y     eval2Bool (D x y) = eval2Bool x || eval2Bool y -type DListFunctionResult = ([PRS] -> [PRS], [PRS] -> [PRS])+type DListFunctionResult = ([PhoneticPhenomenonRep] -> [PhoneticPhenomenonRep], [PhoneticPhenomenonRep] -> [PhoneticPhenomenonRep])  class DListRepresentation a b where     toDLR :: b -> [a] -> ([a] -> [a], [a] -> [a]) -instance DListRepresentation PRS Int8 where+instance DListRepresentation PhoneticPhenomenonRep Int8 where     toDLR left xs         | null xs = (id, id)         | null ts = (id, (zs `mappend`))@@ -310,7 +317,7 @@     deriving (Read, Show)  {- | List of the 'SegmentationRules1' sorted in the descending order by the 'fieldN' 'SegmentationInfo1' data and where the-length of all the 'SegmentationPredFunction' lists of 'PRS' are equal to the 'fieldN' 'SegmentationInfo1' data by definition.+length of all the 'SegmentationPredFunction' lists of 'PhoneticPhenomenonRep' are equal to the 'fieldN' 'SegmentationInfo1' data by definition. -} type SegmentRulesG = [SegmentationRules1] @@ -318,17 +325,17 @@ different neighbour syllables if the group is between two vowels in a word. The group must be not empty, but this is not checked. The example phonetical information for the proper performance in Ukrainian can be found from the: https://msn.khnu.km.ua/pluginfile.php/302375/mod_resource/content/1/%D0%9B.3.%D0%86%D0%86.%20%D0%A1%D0%BA%D0%BB%D0%B0%D0%B4.%D0%9D%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D1%81.pdf-The example of the 'divCnsnts' can be found at: https://hackage.haskell.org/package/ukrainian-phonetics-basic-array-0.1.2.0/docs/src/Languages.Phonetic.Ukrainian.Syllable.Arr.html#divCnsnts+The example of the 'divCnsnts' can be found at: https://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/Aftovolio-Ukrainian-Syllable.html#v:divCnsnts -} divCnsnts ::     -- | The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon (e. g. allophones). Must be sorted in the ascending order to be used correctly.     [(Char, Char)] ->     SegmentRulesG ->-    [PRS] ->+    [PhoneticPhenomenonRep] ->     DListFunctionResult-divCnsnts ks gs xs@(_ : _) = toDLR left xs+divCnsnts allophones segmentRules xs@(_ : _) = toDLR left xs   where-    !js = fromJust . L.find ((== length xs) . fromEnum . fieldN . infoS) $ gs -- js :: SegmentationRules1+    !js = fromJust . L.find ((== length xs) . fromEnum . fieldN . infoS) $ segmentRules -- js :: SegmentationRules1     !left = resF . fromJust . L.find (eval2Bool . predF) . lineFs $ js divCnsnts _ _ [] = (id, id) @@ -336,17 +343,17 @@     -- | The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon (e. g. allophones). Must be sorted in the ascending order to be used correctly.     [(Char, Char)] ->     SegmentRulesG ->-    [[PRS]] ->-    [[PRS]]-reSyllableCntnts ks gs (xs : ys : zs : xss)+    [[PhoneticPhenomenonRep]] ->+    [[PhoneticPhenomenonRep]]+reSyllableCntnts allophones segmentRules (xs : ys : zs : xss)     | (/= P 0) . phoneType . last $ ys =-        fst (divCnsnts ks gs ys) xs-            : reSyllableCntnts ks gs (snd (divCnsnts ks gs ys) zs : xss)-    | otherwise = reSyllableCntnts ks gs ((xs `mappend` ys) : zs : xss)+        fst (divCnsnts allophones segmentRules ys) xs+            : reSyllableCntnts allophones segmentRules (snd (divCnsnts allophones segmentRules ys) zs : xss)+    | otherwise = reSyllableCntnts allophones segmentRules ((xs `mappend` ys) : zs : xss) reSyllableCntnts _ _ (xs : ys : _) = [(xs `mappend` ys)] reSyllableCntnts _ _ xss = xss -divSylls :: [[PRS]] -> [[PRS]]+divSylls :: [[PhoneticPhenomenonRep]] -> [[PhoneticPhenomenonRep]] divSylls = mapI (\ws -> (length . filter createsSyllable $ ws) > 1) h3   where     h3 us =@@ -355,6 +362,12 @@       where         (ys, zs) = break createsSyllable us +-- | Basic group of delimiters in the 'String' that are not converted to the phonemes or not silent sounds. Silent sounds or their absense, e. g. word gaps.+type BasicSpaces = String++-- | Is used for additional delimiters that are not included in the 'BasicSpaces' group for some reason.+type AdditionalDelimiters = String+ {- | The function actually creates syllables using the provided data. Each resulting inner-most list is a phonetic language representation of the syllable according to the rules provided. -}@@ -366,27 +379,27 @@     CharPhoneticClassification ->     SegmentRulesG ->     -- | Corresponds to the 100 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    BasicSpaces ->     -- | Corresponds to the 101 delimiter in the @ukrainian-phonetics-basic-array@ package.-    String ->+    AdditionalDelimiters ->     -- | Actually the converted 'String'.     String ->-    [[[PRS]]]-createSyllablesPL wrs ks arr gs us vs =-    map (divSylls . reSyllableCntnts ks gs . groupSnds . str2PRSs arr)+    [[[PhoneticPhenomenonRep]]]+createSyllablesPL writingSystem allophones arrayCharClassification segmentRules basicSpaces additionalDelims =+    map (divSylls . reSyllableCntnts allophones segmentRules . groupSnds . str2PRSs arrayCharClassification)         . words1         . mapMaybe g         . convertToProperPL         . map (\x -> if x == '-' then ' ' else x)   where     g x-        | x `elem` us = Nothing-        | x `notElem` vs = Just x+        | x `elem` basicSpaces = Nothing+        | x `notElem` additionalDelims = Just x         | otherwise = Just ' '     words1 xs = if null ts then [] else w : words1 s'' -- Practically this is an optimized version for this case 'words' function from Prelude.       where         ts = dropWhile (== ' ') xs         (w, s'') = break (== ' ') ts     {-# NOINLINE words1 #-}-    convertToProperPL = concatMap string1 . stringToXG wrs+    convertToProperPL = concatMap string1 . stringToXG writingSystem {-# INLINE createSyllablesPL #-}
Aftovolio/Ukrainian/IO.hs view
@@ -100,7 +100,7 @@ generalF power10 ldc compards html filtering dcfile selStr (prestr, poststr) lineNmb file numTest hc (grps, mxms) k hashStep emptyline splitting (fs, code) concurrently initstr universalSet@(_ : _ : _) = do     syllableDurationsDs <- readSyllableDurations file     let syllN = countSyll initstr-        f ldc compards syllableDurationsDs grps mxms -- Since the version 0.12.0.0, has a possibility to evaluate diversity property.+        f ldc compards syllableDurationsDs grps mxms              | L.null selStr =                 ( if doubleFunc (L.null :: [Word8] -> Bool) (L.null :: [Int8] -> Bool) compards                     then (sum . R.countHashes2G hashStep hc grps mxms)
CHANGELOG.md view
@@ -48,3 +48,7 @@  * Sixth version revised A. Fixed some issues with the documentation. +## 0.6.2.0 -- 2024-11-30++* Sixth version revised B. Improved documentation and code readability for several modules.+
README.md view
@@ -113,9 +113,9 @@  ## Ability to use your own durations of representations of sounds or phonetic phenomena -The programs offer four different sets of phonetic representations by default but it is possible to set your own durations. To do this, specify them as numbers of type 'Word8' (that can be obtained from the 'Double' values from the convex hull envelope method above or from some analogous procedure by the function [zippedDouble2Word8](https://hackage.haskell.org/package/aftovolio-0.6.1.0/docs/src/Aftovolio.General.Datatype3.html#zippedDouble2Word8), see documentation for the [module](https://hackage.haskell.org/package/aftovolio-0.6.1.0/docs/src/Aftovolio.General.Datatype3.html)) in the file in the order defined as follows:+The programs offer four different sets of phonetic representations by default but it is possible to set your own durations. To do this, specify them as numbers of type 'Word8' (that can be obtained from the 'Double' values from the convex hull envelope method above or from some analogous procedure by the function [zippedDouble2Word8](https://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/src/Aftovolio.General.Datatype3.html#zippedDouble2Word8), see documentation for the [module](https://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/src/Aftovolio.General.Datatype3.html)) in the file in the order defined as follows: -where the specified values in the list refer to the [phonetic representations](https://hackage.haskell.org/package/aftovolio-0.6.1.0/docs/src/Aftovolio.Ukrainian.Syllable.html#showS8) from the module Aftovolio.Ukrainian.Syllable. The last column is 8-bit integers (GHC.Int.Int8), which represent these sounds in the new modules.+where the specified values in the list refer to the [phonetic representations](https://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/src/Aftovolio.Ukrainian.Syllable.html#showS8) from the module Aftovolio.Ukrainian.Syllable. The last column is 8-bit integers (GHC.Int.Int8), which represent these sounds in the new modules.  If you want to specify several such sets (up to 9 inclusive), you can specify '\*' or several such characters from a new line, and then from the next line there will be a new set of values. @@ -323,28 +323,27 @@  Let's pay attention to the second line - \"Хрущі над вишнями гудуть.\" In it, the words \"хрущі\" and \"гудуть\" with \"у\" are placed as far as possible from each other. This suggests that this line satisfies the property y0.y. We check: -  aftovolioUkr +ul y0.у Хрущі над вишнями гудуть-  7 Хрущі гудуть надвишнями  3    7 надвишнями Хрущі гудуть  4-  6 надвишнями гудуть Хрущі  2    18 гудуть надвишнями Хрущі  5-  6 гудуть Хрущі надвишнями  1    19 Хрущі надвишнями гудуть  6-  -Indeed, 19 out of a maximum possible 19! But it can be noticed that the vowels in the words are selected so that they do not repeat closely, so the maximum can be expected not only for y0.y, but also for the more general property y0.vw:+    aftovolioUkr +ul y0.у Хрущі над вишнями гудуть+    7 Хрущі гудуть надвишнями  3    7 надвишнями Хрущі гудуть  4+    6 надвишнями гудуть Хрущі  2    18 гудуть надвишнями Хрущі  5 -  aftovolioUkr +ul y0.vw Хрущі над вишнями гудуть-  7 Хрущі гудуть надвишнями  3    7 надвишнями Хрущі гудуть  4-  6 надвишнями гудуть Хрущі  2    18 гудуть надвишнями Хрущі  5-  6 гудуть Хрущі надвишнями  1    19 Хрущі надвишнями гудуть  6-  -Again the maximum 19 out of 19 possible! Okay, that's it for this line. And for the whole poem? If we check every line with +Indeed, 19 out of a maximum possible 19! But it can be noticed that the vowels in the words are selected so that they do not repeat closely, so the maximum can be expected not only for y0.y, but also for the more general property y0.vw: -  aftovolioUkr +ul y0.vw+    aftovolioUkr +ul y0.vw Хрущі над вишнями гудуть+    7 Хрущі гудуть надвишнями  3    7 надвишнями Хрущі гудуть  4+    6 надвишнями гудуть Хрущі  2    18 гудуть надвишнями Хрущі  5+    6 гудуть Хрущі надвишнями  1    19 Хрущі надвишнями гудуть  6 +Again the maximum 19 out of 19 possible! Okay, that's it for this line. And for the whole poem? If we check every line with +  +    aftovolioUkr +ul y0.vw+   command, then we see many maximums.   We check: indeed, many maximums! But not all\.\.\. Let's try to add something or take something away to increase the number of maxima, then this new property will be the most appropriate. Let's see where there are no maxima and why. For example, lines in a row --- \"А матері вечерять ждуть. // Сем'я вечеря коло хати // \" --- in them we notice that the sounds \"е\" are close to each other. Then if you take away the \"е\", maybe it will be closer to the maximum? We check:--  aftovolioUkr +ul y0.а.о.у.и.і-+  +    aftovolioUkr +ul y0.а.о.у.и.і+   We pay attention, indeed, for these lines there was a shift towards maximums, the last line \"Та соловейко не затих\" also \"risen\" to the maximum (admittedly, from two possible options). Instead, the line \"Дочка вечерять подає\" \"dropped\" from the maximum to the 3 interval. It can be assumed that the \"status\" of \"е\" in the poem is \"unclear\": with or without it.  As you can see, it is not possible to achieve maximums everywhere under various options. This is especially true of the three lines in a row at the end: \"Поклала мати коло хати // Маленьких діточок своїх // Сама заснула коло їх\" And also \"Співають ідучи дівчата // А матері вечерять ждуть.\" In the second case, can see that \"у\" alternates with \"i\", that is, we have \"ю(у) - i - y\", as well as in the next \"e - i - e - e\". It can be assumed that there is 'art sound painting' here - vowels alternate to reproduce the motifs of the melody and rhythm of folk songs. Similarly, it can be assumed that before the end of the poem, the vowels begin to \"group\" closer, that is, a \"coherent, dynamic\" effect is created, that is, amplification, and it can be thought that it describes a certain change in the situation. Let's see, it can really be called the highest point (climax) of the poem, and therefore its amplification by grouping of vowels creates the effect of the top of the picture. Accordingly, it is necessary to read (recite) these lines (this is justified, see the title) with a certain acceleration, not measured, but more cohesively. At the same time, es where we have a maximum for vowels (or vowels with deaf consonants) should be read more measuredly, so that it is possible to see the richness of the painting, its calmness and stability. The penultimate line has a pause in the middle---like a pause after a highest point (climax). And then the denouement.@@ -369,10 +368,11 @@  See, for example: -  aftovolioUkr -e +r 21 садок=133 вишне=133вий ко=133лоха=133ти хрущі=133 над ви=133шнями гудуть=133-  \...-  8 садок вишневий колохати надвишнями гудуть хрущі  711-  +    aftovolioUkr -e +r 21 садок=133 вишне=133вий ко=133лоха=133ти хрущі=133 над ви=133шнями гудуть=133+    ...+    8 садок вишневий колохати надвишнями гудуть хрущі  711+    ...+  as the element with the maximum value (the "-e" command line argument suppresses output of "={digits}" for better readability). The second line is changed because of the last syllable in the first line that is redundant as for the iambic meter.  You can easily paste the =133 group into the text in many editors or on the command line directly.@@ -445,11 +445,10 @@  - +r   — afterwards are several unique digits not greater than 8 in the descending order — the first one is the length of the group of syllables to be considered as a period, the rest — positions of the maximums and minimums. Example: "543" means that the line is split into groups of 5 syllables starting from the beginning, then the positions of the most maximum (4 = 5 - 1) and the next (smaller) maximum (3 = 4 - 1). If there are no duplicated values then the lowest possible value here is 0, that corresponds to the lowest minimum. If there are duplicates then the lowest value here is the number of the groups of duplicates, e. g. in the sequence 1,6,3,3,4,4,5 that is one group there are two groups of duplicates — with 3 and 4 — and, therefore, the corresponding data after +r should be 7\.\.\.2. The values less than the lowest minimum are neglected. -- +c   — see explanation at [the link](https://hackage.haskell.org/package/rhythmic-sequences-0.3.0.0/docs/src/Rhythmicity.MarkerSeqs.html#HashCorrections). Some preliminary tests show that theee corrections influence the result but not drastically, they can lead to changes in groupping and order, but mostly leave the structure similar. This shows that the algorithms used are more stable for such changes.+- +c   — see explanation at [the link](https://hackage.haskell.org/package/rhythmic-sequences-0.8.0.0/docs/src/Rhythmicity.MarkerSeqs.html#HashCorrections). Some preliminary tests show that theee corrections influence the result but not drastically, they can lead to changes in groupping and order, but mostly leave the structure similar. This shows that the algorithms used are more stable for such changes.  - -t   — and afterwards the number in the range [0..179]  (with some exceptions) showing the test for 'smoothness' (to be more accurate - absence or presence of some irregularities that influences the prosody) to be run - you can see a list of possible values for the parameter here at the link:-[link1](https://hackage.haskell.org/package/phladiprelio-ukrainian-simple-0.6.0.0/src/app/Main.hs) on the lines number: 51; 56-115; 118-126. The first section of the lines numbers 56-63 and 120 corresponds to the detailed explanation below.-For ideas of actual usage of the tests, see the documentation above.+[link1](https://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/src/Aftovolio.Tests.html#sel). For ideas of actual usage of the tests, see the documentation above.  - -C   — If specified with +RTS -N -RTS rtsoptions for the multicore computers with -t option then it can speed up the full computation of the all tests using more resources. Uses asynchcronous concurrent threads in computation. This groups (-C and rtsoptions) can be specified in any position as command line groups of arguments. The output is in this case not sorted in the order of 2,3,4,5,6,7, but can vary depending on your CPU configurations and states and / or some other factors. @@ -457,6 +456,8 @@  - +x   — If specified with the further natural number then means that instead of maximum 7 words or their concatenations that can be analysed together as a line there will be taken the specified number here or 9 if the number is greater than 8. More words leads to more computations, therefore, please, use with this caution in mind. It can be useful mostly for the cases with the additional constraints specified (+a \.\.\. -a or +b \.\.\. -b groups, see above). +- -cm   — If present, the program works in a special comparative mode reading information from the several files line-by-line and prompting to choose the resulting option from the files given. If some files do not have such lines, then the resulting option for the file is empty. You choose the resulting option by typing its number on the terminal. The total number of sources is limited to no more than 14.+ - +m   — If present followed with two arguments — the name of the file to be used for reading data for multiline processment and the second one — the number of line to be processed. The numeration of the lines in the file for the aftovolioUkr program here starts from 1 (so, it is: 1, 2, 3, 4,.. etc). The program then uses instead of text the specified line from the file specified here and prints information about its previous and next lines (if available).  - +m2   — If present, it means that the line with the corresponding number specified here will be taken from the same file specified as +m \<file\>. For example, the entry +m \<file\> 1 +m2 4 means that 1 line will be taken from the file \<file\> for the similarity analysis and it will be compared not with contents of +l2 \.\.\. -l2, but with the 4th line from the same file.@@ -465,6 +466,8 @@  If \<num1\> == \<num2>, then there is at least one of all the options with a property value of 0. +# "Music" mode of operation and extended possibilities+ You can also use the "music" mode, which allows you to write better lyrics and music. To do this, you can add a record of the form \_{set of digits} or ={set of digits} to a word or between syllables after the needed to be referred to, and this set of digits will be converted to a non-negative Double number by the program and then used to modulate the duration of the previous syllable or of the additional one(s) added here. The first digit in the record after '=' or '\_' is a whole number and the rest is a fraction (mantissa).  If you have added \_{set of digits} then this number will be multiplied by the duration of the syllable to which this insertion refers, and the resulting number will be rounded so that is can be no more than 255 (the maximum possible value of Word8 datatype that is used internally to calculate the statistics). Afterwards, this value is placed among the others in the place where this entry is inserted.@@ -478,6 +481,4 @@ If you specify \_1, \_10, \_100, \_1000, etc. as such an insertion, the program will assume that this insertion duration is equal to the duration of the syllable to which it refers. If the set of digits is preceded by a 0, the insertion has a shorter duration, if the 1 in the first 4 examples above is followed by digits other than 0, or if another digit is used instead of 1 or 0, the insertion has a longer duration. For example, \_05 means exactly half the duration of the syllable, and \_2 means double the duration. In any case the resulting values cannot be greater than 255, the greater ones are rounded to 255.  For the "music" mode the number of syllables printed for the line does include the inserts.--- -cm   — If present, the program works in a special comparative mode reading information from the several files line-by-line and prompting to choose the resulting option from the files given. If some files do not have such lines, then the resulting option for the file is empty. You choose the resulting option by typing its number on the terminal. The total number of sources is limited to no more than 14. 
aftovolio.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               aftovolio-version:            0.6.1.0+version:            0.6.2.0  -- A short (one-line) description of the package. synopsis:           An AFTOVolio implementation for creating texts with special phonetic / prosodic properties.
src/Main.hs view
@@ -168,12 +168,12 @@   | xs == "l" = putStrLn "+l \t— if specified then the output for one property (no tests) contains empty lines between the groups of the line option with the same value of property. \n"   | xs == "w" = putStrLn "+w \t— if specified with the next Int8 number then the splitting of the output for non-testing options is used. Is used when no \"-t\" argument is given. The output is split into two columns to improve overall experience. The parameter after the \"+w\" is divided by 10 (-10 for negative numbers) to obtain the quotient and remainder (Int8 numbers). The quotient specifies the number of spaces or tabular characters to be used between columns (if the parameter is positive then the spaces are used, otherwise tabular characters). The remainder specifies the option of displaying. If the absolute value of the remainder (the last digit of the parameter) is 1 then the output in the second column is reversed; if it is in the range [2..5] then the output is groupped by the estimation values: if it is 2 then the first column is reversed; if it is 3 then the second column is reversed; if it is 4 then like 2 but additionally the empty line is added between the groups; if it is 5 then like for 3 and additionally the empty line is added between the groups. Otherwise, the second column is reversed. The rules are rather complex, but you can give a try to any number (Int8, [129..128] in the fullscreen terminal). The default value is 54 that corresponds to some reasonable layout.\n"   | xs == "s" = putStrLn "+s \t— the next is the digit from 1 to 4 included. The default one is 2. Influences the result in the case of +d parameter is not given. \n"-  | xs == "d" = putStrLn "+d \t— if present, then afterwards should be a FilePath to the file with new durations of the Ukrainian AFTOVolio representations. They can be obtained using the information from the section on durations in the REEDME.md file by the following link: \nhttps://hackage.haskell.org/package/aftovolio-0.6.1.0/src/README.md\n"+  | xs == "d" = putStrLn "+d \t— if present, then afterwards should be a FilePath to the file with new durations of the Ukrainian AFTOVolio representations. They can be obtained using the information from the section on durations in the REEDME.md file by the following link: \nhttps://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md\n"   | xs == "p" = putStrLn "-p \t— if present the minimal grammar transformations (appending and prepending the dependent parts) are not applied. Can be useful also if the text is analyzed as a Ukrainian transcription of text in some other language.\n"   | xs == "f" = putStrLn "+f \t— if present with two arguments specifies the file to which the output information should be appended and the mode of appending (which parts to write). The default value if the secodnd parameter is 0 or not element of [1,2,3,4,10,11,12,13,14,15,16,17,18,19] is just the resulting String option. If the second parameter is 1 then the sequential number and the text are written; if it is 2 then the estimation value and the string are written; if it is 3 then the full information is written i. e. number, string and estimation; if it is 4 then the number and estimation (no string).\nThe second arguments greater or equal to 10 take effect only if the meter consists of two syllables (in case of \"+r 21\" command line options given). If it is 10 in such a case then before appending the line option itself to the given file there is hashes information for this line option displayed. If it is 11 — the same hashes information is displayed before processing as for 1. If it is 12 — the same hashes information is displayed before processing as for 2 and so on for 13, 14. If it is 15 up to 19 — it is analogically to the the 10–14 but the hashes information is not only printed on the screen, but appended to the file specified. These values are intended to test the interesting hypothesis about where the pauses can occur. For more information on the hypothesis, see: \n https://www.academia.edu/105067761/Why_some_lines_are_easy_to_pronounce_and_others_are_not_or_prosodic_unpredictability_as_a_characteristic_of_text\n"   | xs == "dc" = putStrLn "+dc \t— if specified with two further arguments then the first one can be 1 or something  else. If it is 1 then additionally to every line as usual there is printed also <br> html tag at the end of the line for the two-columns output. Otherwise, nothing is added to each line. The second argument further is a FilePath to the writable existing file or to the new file that will be located in the writable by the user directory. The two-column output will be additionally written to this file if it is possible, otherwise the program will end with an exception.\n"-  | xs == "a" = putStrLn "+a ... -a \t— if present contains a group of constraints for AFTOVolio. For more information, see: \nhttps://hackage.haskell.org/package/aftovolio-0.5.1.1/src/README.md in English or in Ukrainian: \nhttps://oleksandr-zhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Ukr.21.html#%D0%BE%D0%B1%D0%BC%D0%B5%D0%B6%D0%B5%D0%BD%D0%BD%D1%8F-constraints\n"-  | xs == "b" = putStrLn "+b ... -b \t— if present takes precedence over those ones in the +a ... -a group (the latter ones have no effect). A group of constraints for AFTOVolio using some boolean-based algebra. If you use parentheses there, please, use quotation of the whole expression between the +b and -b (otherwise there will be issues with the shell or command line interpreter related to parentheses). For example, on Linux bash or Windows PowerShell: +b \'P45(A345 B32)\' -b. If you use another command line environment or interpreter, please, refer to the documentation for your case about the quotation and quotes. For more information, see: \nhttps://hackage.haskell.org/package/aftovolio-0.5.1.1/src/README.md in English or: \nhttps://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioUkr.7.pdf in Ukrainian.\n"+  | xs == "a" = putStrLn "+a ... -a \t— if present contains a group of constraints for AFTOVolio. For more information, see: \nhttps://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md in English or in Ukrainian: \nhttps://oleksandr-zhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Ukr.21.html#%D0%BE%D0%B1%D0%BC%D0%B5%D0%B6%D0%B5%D0%BD%D0%BD%D1%8F-constraints\n"+  | xs == "b" = putStrLn "+b ... -b \t— if present takes precedence over those ones in the +a ... -a group (the latter ones have no effect). A group of constraints for AFTOVolio using some boolean-based algebra. If you use parentheses there, please, use quotation of the whole expression between the +b and -b (otherwise there will be issues with the shell or command line interpreter related to parentheses). For example, on Linux bash or Windows PowerShell: +b \'P45(A345 B32)\' -b. If you use another command line environment or interpreter, please, refer to the documentation for your case about the quotation and quotes. For more information, see: \nhttps://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md in English or: \nhttps://oleksandr-zhabenko.github.io/uk/rhythmicity/phladiprelioUkr.7.pdf in Ukrainian.\n"   | xs == "P" = putStrLn "+P \t— if specified with the following non-negative Int from 0 to 3 including then specifies the general type of permutations of the words and their concatenations. +P 0 corresponds the full set of all possible permutations (the default behaviour, also in case of no specification at all), +P 1 corresponds to the set of permutations, where just one word can change its position (the elementary, the least possible permutation), +P 2 corresponds to the set of permutations, where two words can be swapped one with another, +P 3 corresponds to the set of permutations, where no more than two words can change their positions, including the cases of no changes at all and just one word changes its position. All, except +P 0 provide less permutations in general and are quicker to be computed and displayed. This one is more useful in case of extended sets of words, e. g. when there are 8 or 9 words in the line."   | xs == "l2" = putStrLn "+l2 ... -l2 \t— if present and has inside Ukrainian text then the line options are compared with it using the idea of lists similarity. The greater values correspond to the less similar and more different lines. Has no effect with +dc group of command line arguments. Has precedence over +t, +r, +k, +c etc. groups of command line options so that these latter ones have no effect when +l2 ... -l2 is present.\n"   | xs == "ln" = putStrLn "+ln ... -ln \t— if present and has inside a sequence of Word8 values i. e. positive integer numbers less than 256 then the line options are compared with it using the idea of lists similarity. The greater values correspond to the less similar and more different lines. Has no effect with +dc group of command line arguments. Has precedence over +t, +r, +k, +c etc. groups of command line options so that these latter ones have no effect when +ln ... -ln is present.\n"@@ -182,8 +182,8 @@   | xs == "q" = putStrLn "+q \t— if present with +l2 ... -l2 group of arguments then the next argument is a power of 10 which the distance between line option and the predefined line is quoted by. The default one is 0 (that means no change). You can specify not less than 0 and not greater than 4. Otherwise, these limit numbers are used instead. The greater value here leads to more groupped options output.\n"   | xs == "ul" = putStrLn "+ul \t— afterwards there is a string that encodes which sounds are used for diversity property evaluation. If used, then +r group has no meaning and is not used. Unlike in the link, the argument \"1\" means computing the property for all the sound representations included (for all of the present representations, so the value is maximal between all other strings instead of \"1\"). For more information, see: https://oleksandr-zhabenko.github.io/uk/rhythmicity/PhLADiPreLiO.Eng.21.html#types\n"   | xs == "r" = putStrLn "+r \t— afterwards are several unique digits not greater than 8 in the descending order — the first one is the length of the group of syllables to be considered as a period, the rest — positions of the maximums and minimums. Example: \"543\" means that the line is split into groups of 5 syllables starting from the beginning, then the positions of the most maximum (4 = 5 - 1) and the next (smaller) maximum (3 = 4 - 1). If there are no duplicated values then the lowest possible value here is 0, that corresponds to the lowest minimum. If there are duplicates then the lowest value here is the number of the groups of duplicates, e. g. in the sequence 1,6,3,3,4,4,5 that is one group there are two groups of duplicates — with 3 and 4 — and, therefore, the corresponding data after +r should be 7...2. The values less than the lowest minimum are neglected.\n"-  | xs == "c" = putStrLn "+c \t— see explanation at the link: https://hackage.haskell.org/package/rhythmic-sequences-0.3.0.0/docs/src/Rhythmicity.MarkerSeqs.html#HashCorrections Some preliminary tests show that theee corrections influence the result but not drastically, they can lead to changes in groupping and order, but mostly leave the structure similar. This shows that the algorithms used are more stable for such changes.\n"-  | xs == "t" = putStrLn "-t \t— and afterwards the number in the range [0..179] (with some exceptions) showing the test for \'smoothness\' (to be more accurate - absence or presence of some irregularities that influences the prosody) to be run - you can see a list of possible values for the parameter here at the link: \nhttps://hackage.haskell.org/package/phladiprelio-ukrainian-simple-0.6.0.0/src/app/Main.hs  on the lines number: 51; 56-115; 118-126. The first section of the lines numbers 56-63 and 120 corresponds to the detailed explanation below. \nFor ideas of actual usage of the tests, see the documentation by the links: https://www.academia.edu/105067723/%D0%A7%D0%BE%D0%BC%D1%83_%D0%B4%D0%B5%D1%8F%D0%BA%D1%96_%D1%80%D1%8F%D0%B4%D0%BA%D0%B8_%D0%BB%D0%B5%D0%B3%D0%BA%D0%BE_%D0%B2%D0%B8%D0%BC%D0%BE%D0%B2%D0%BB%D1%8F%D1%82%D0%B8_%D0%B0_%D1%96%D0%BD%D1%88%D1%96_%D0%BD%D1%96_%D0%B0%D0%B1%D0%BE_%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B4%D0%B8%D1%87%D0%BD%D0%B0_%D0%BD%D0%B5%D1%81%D0%BF%D1%80%D0%BE%D0%B3%D0%BD%D0%BE%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D1%96%D1%81%D1%82%D1%8C_%D1%8F%D0%BA_%D1%85%D0%B0%D1%80%D0%B0%D0%BA%D1%82%D0%B5%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D1%83?source=swp_share and https://hackage.haskell.org/package/aftovolio-0.5.1.1/src/README.md\n"+  | xs == "c" = putStrLn "+c \t— see explanation at the link: https://hackage.haskell.org/package/rhythmic-sequences-0.8.0.0/docs/src/Rhythmicity.MarkerSeqs.html#HashCorrections Some preliminary tests show that theee corrections influence the result but not drastically, they can lead to changes in groupping and order, but mostly leave the structure similar. This shows that the algorithms used are more stable for such changes.\n"+  | xs == "t" = putStrLn "-t \t— and afterwards the number in the range [0..179] (with some exceptions) showing the test for \'smoothness\' (to be more accurate - absence or presence of some irregularities that influences the prosody) to be run - you can see a list of possible values for the parameter here at the link: \nhttps://hackage.haskell.org/package/aftovolio-0.6.2.0/docs/src/Aftovolio.Tests.html#sel. \nFor ideas of actual usage of the tests, see the documentation by the links: https://www.academia.edu/105067723/%D0%A7%D0%BE%D0%BC%D1%83_%D0%B4%D0%B5%D1%8F%D0%BA%D1%96_%D1%80%D1%8F%D0%B4%D0%BA%D0%B8_%D0%BB%D0%B5%D0%B3%D0%BA%D0%BE_%D0%B2%D0%B8%D0%BC%D0%BE%D0%B2%D0%BB%D1%8F%D1%82%D0%B8_%D0%B0_%D1%96%D0%BD%D1%88%D1%96_%D0%BD%D1%96_%D0%B0%D0%B1%D0%BE_%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B4%D0%B8%D1%87%D0%BD%D0%B0_%D0%BD%D0%B5%D1%81%D0%BF%D1%80%D0%BE%D0%B3%D0%BD%D0%BE%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D1%96%D1%81%D1%82%D1%8C_%D1%8F%D0%BA_%D1%85%D0%B0%D1%80%D0%B0%D0%BA%D1%82%D0%B5%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D1%83?source=swp_share and https://hackage.haskell.org/package/aftovolio-0.6.2.0/src/README.md\n"   | xs == "C" = putStrLn "-C \t— If specified with +RTS -N -RTS rtsoptions for the multicore computers with -t option then it can speed up the full computation of the all tests using more resources. Uses asynchcronous concurrent threads in computation. This groups (-C and rtsoptions) can be specified in any position as command line groups of arguments. The output is in this case not sorted in the order of 2,3,4,5,6,7, but can vary depending on your CPU configurations and states and / or some other factors.\n"   | xs == "k" = putStrLn "+k \t— and then the number greater than 2 (better, greater than 12, the default value if not specified is 20). The greater value leads to greater numbers. The number less than some infimum here leads to wiping of some information from the result and, therefore, probably is not the desired behaviour. For most cases the default value is just enough sensible, but you can give it a try for other values.\n"   | xs == "x" = putStrLn "+x \t— If specified with the further natural number then means that instead of maximum 7 words or their concatenations that can be analysed together as a line there will be taken the specified number here or 9 if the number is greater than 8. More words leads to more computations, therefore, please, use with this caution in mind. It can be useful mostly for the cases with the additional constraints specified (+a ... -a or +b ... -b groups, see above).\n"