packages feed

phonetic-languages-simplified-generalized-examples-array 0.13.1.0 → 0.14.0.0

raw patch · 10 files changed

+211/−95 lines, 10 filesdep +cli-argumentsdep ~basedep ~phonetic-languages-permutations-arraydep ~phonetic-languages-simplified-basePVP ok

version bump matches the API change (PVP)

Dependencies added: cli-arguments

Dependency ranges changed: base, phonetic-languages-permutations-array, phonetic-languages-simplified-base, phonetic-languages-simplified-generalized-properties-array

API changes (from Hackage documentation)

+ Phonetic.Languages.General.GetInfo.Parsing: aSpcs :: [String] -> Args
+ Phonetic.Languages.General.GetInfo.Parsing: aSpecs :: CLSpecifications
+ Phonetic.Languages.General.GetInfo.Parsing: bSpcs :: [String] -> Args
+ Phonetic.Languages.General.GetInfo.Parsing: bSpecs :: CLSpecifications
+ Phonetic.Languages.General.GetInfo.Parsing: cSpecs1 :: CLSpecifications
+ Phonetic.Languages.General.GetInfo.Parsing: fstCharsM :: FirstChars
+ Phonetic.Languages.General.GetInfo.Parsing: specs1 :: CLSpecifications
+ Phonetic.Languages.General.Lines.Parsing: aSpcs :: [String] -> Args
+ Phonetic.Languages.General.Lines.Parsing: aSpecs :: CLSpecifications
+ Phonetic.Languages.General.Lines.Parsing: bSpcs :: [String] -> Args
+ Phonetic.Languages.General.Lines.Parsing: bSpecs :: CLSpecifications
+ Phonetic.Languages.General.Lines.Parsing: cSpecs1 :: CLSpecifications
+ Phonetic.Languages.General.Lines.Parsing: fstCharsM :: FirstChars
+ Phonetic.Languages.General.Lines.Parsing: specs1 :: CLSpecifications
+ Phonetic.Languages.General.Simple.Parsing: aSpcs :: [String] -> Args
+ Phonetic.Languages.General.Simple.Parsing: aSpecs :: CLSpecifications
+ Phonetic.Languages.General.Simple.Parsing: bSpcs :: [String] -> Args
+ Phonetic.Languages.General.Simple.Parsing: bSpecs :: CLSpecifications
+ Phonetic.Languages.General.Simple.Parsing: cSpecs1MA :: CLSpecifications
+ Phonetic.Languages.General.Simple.Parsing: cSpecs1T :: CLSpecifications
+ Phonetic.Languages.General.Simple.Parsing: fstCharsMA :: FirstChars
+ Phonetic.Languages.General.Simple.Parsing: fstCharsT :: FirstChars
+ Phonetic.Languages.General.Simple.Parsing: specs1 :: CLSpecifications
- Phonetic.Languages.General.GetInfo.Parsing: files4ArgsProcessment :: Bool -> FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> [String] -> IO ()
+ Phonetic.Languages.General.GetInfo.Parsing: files4ArgsProcessment :: PermutationsType -> FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> [String] -> IO ()
- Phonetic.Languages.General.GetTextualInfo: generalProc :: Bool -> (Int, Int) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> String -> String -> Bool -> [String] -> [String] -> Coeffs2 -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()
+ Phonetic.Languages.General.GetTextualInfo: generalProc :: PermutationsType -> (Int, Int) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> String -> String -> Bool -> [String] -> [String] -> Coeffs2 -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()
- Phonetic.Languages.General.GetTextualInfo: getData3 :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()
+ Phonetic.Languages.General.GetTextualInfo: getData3 :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()
- Phonetic.Languages.General.Lines: generalProcessment :: Bool -> (Int, Int) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> String -> String -> Coeffs2 -> [String] -> [String] -> Int -> FilePath -> IO ()
+ Phonetic.Languages.General.Lines: generalProcessment :: PermutationsType -> (Int, Int) -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> String -> String -> Coeffs2 -> [String] -> [String] -> Int -> FilePath -> IO ()
- Phonetic.Languages.General.Simple: finalProc :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> (a -> String) -> [a] -> [String] -> Bool -> IO String
+ Phonetic.Languages.General.Simple: finalProc :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> (a -> String) -> [a] -> [String] -> Bool -> IO String
- Phonetic.Languages.General.Simple: generalProc2 :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO String
+ Phonetic.Languages.General.Simple: generalProc2 :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO String
- Phonetic.Languages.General.Simple: generalProc2G :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
+ Phonetic.Languages.General.Simple: generalProc2G :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
- Phonetic.Languages.General.Simple: generalProc3G :: Bool -> (String -> Bool) -> [String] -> String -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
+ Phonetic.Languages.General.Simple: generalProc3G :: PermutationsType -> (String -> Bool) -> [String] -> String -> Int -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
- Phonetic.Languages.General.Simple: generalProcMMs :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> [String] -> Bool -> IO String
+ Phonetic.Languages.General.Simple: generalProcMMs :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> [String] -> Bool -> IO String
- Phonetic.Languages.General.Simple: interactivePrintResultRecursive :: Bool -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> (a -> String) -> [a] -> [String] -> Bool -> IO String
+ Phonetic.Languages.General.Simple: interactivePrintResultRecursive :: PermutationsType -> GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> (a -> String) -> [a] -> [String] -> Bool -> IO String
- Phonetic.Languages.General.Simple.Parsing: argsToSimplePrepare4Files :: Bool -> FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> String -> (String -> Bool) -> [String] -> String -> Int -> IO ()
+ Phonetic.Languages.General.Simple.Parsing: argsToSimplePrepare4Files :: PermutationsType -> FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> String -> (String -> Bool) -> [String] -> String -> Int -> IO ()

Files

ChangeLog.md view
@@ -156,3 +156,10 @@  * The thirteenth version revised A. Imlemented pairwise permutations mode more deeply. Some documentation improvements. Updated the dependencies boundaries.++## 0.14.0.0 -- 2022-01-17++* The fourteenth version. Added cli-arguments as a new dependency. Changed the way the programs parse their arguments.+Added the possibility to use also minimal set of permutations (just one word). Updated the dependencies. Some code+improvements. Updated the documentation with the new material and fixed obsoleted output examples for the+Ukrainian implementation (phonetic-languages-simplified-examples-array).
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2021 Oleksndr Zhabenko+Copyright (c) 2021-2022 Oleksndr Zhabenko  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
Phonetic/Languages/General/GetInfo/Parsing.hs view
@@ -1,6 +1,6 @@ -- | -- Module      :  Phonetic.Languages.General.GetInfo.Parsing--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -22,17 +22,21 @@ import Phonetic.Languages.General.Common import Phonetic.Languages.General.Lines import Data.Phonetic.Languages.PrepareText-import Phonetic.Languages.General.Lines import Data.List (sort) import GHC.Arr import Data.Phonetic.Languages.Base import Data.Phonetic.Languages.Syllables import Data.Phonetic.Languages.SpecificationsRead-import Phonetic.Languages.General.Simple.Parsing+import Phonetic.Languages.General.Simple.Parsing (innerProcessmentSimple) import Phonetic.Languages.Array.General.PropertiesSyllablesG2 import Phonetic.Languages.General.Simple import Data.Phonetic.Languages.SpecificationsRead+import CLI.Arguments+import CLI.Arguments.Parsing+import CLI.Arguments.Get+import qualified Phonetic.Languages.Permutations.Represent as R + -- | The first 4 arguments are the file names with the specifications. -- 1) with the 'GWritingSystemPRPLX' specifications only (see the gwrsysExample.txt file in the @phonetic-languages-phonetics-basics@ package as a schema); --@@ -53,14 +57,14 @@  -> IO () argsToGetInfoProcessment h qs = do  args50 <- getArgs- let args40 = filter (/= "+p") args50-     pairwisePermutations = any (== "+p") args50+ let (pPs,args40) = takeBsR [("+p",1)] args50+     pairwisePermutations = R.bTransform2Perms . getB "+p" $ pPs      (!args14,!args000) = splitAt 4 args40      [fileGWrSys, controlFile, segmentRulesFile, concatenationsFileP] = args14  files4ArgsProcessment pairwisePermutations fileGWrSys controlFile segmentRulesFile concatenationsFileP h qs args000  files4ArgsProcessment-  :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+  :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.   -> FilePath -- ^ With the 'GWritingSystemPRPLX' specifications only (see the gwrsysExample.txt file in the @phonetic-languages-phonetics-basics@ package as a schema);   -> FilePath -- ^ With the 5 meaningful lines that are delimited with the \'~\' line one from another with the specifications for the possible allophones (if any), 'CharPhoneticClassification', white spaces information (two 'String's) and the 'String' of all the possible 'PLL' 'Char's;   -> FilePath -- ^ With the 'SegmentRulesG' specifications only;@@ -75,21 +79,22 @@   -> [String] -- ^ List of other command line arguments   -> IO () files4ArgsProcessment pairwisePermutations !fileGWrSys !controlFile !segmentRulesFile !concatenationsFileP h qs args000 = do- let !args00 = filter (\ts -> take 2 ts /= "+x" && ts /= "+b" && take 2 ts /= "+g") args000-     !growing = filter ((== "+g") . (take 2)) args000+ let (argsA,argsB,argsC1,argss) = args2Args31R fstCharsM specs1 args000+     !args00 = snd . takeAsR [("+b",0)] . snd . takeBsR [("+x",1),("+g",1)] $ args000+     !growing = concat . getB "+g" $ argsB      (!gr1,!gr2)             | null growing = (0,0)-            | otherwise = let (nms,mms) = splitAt 1 . drop 2 . take 4 $ growing-                              nm = readMaybe (concat nms)::Maybe Int-                              mm = readMaybe (concat mms)::Maybe Int in case (nm,mm) of+            | otherwise = let (nms,mms) = splitAt 1 growing+                              nm = readMaybe nms::Maybe Int+                              mm = readMaybe mms::Maybe Int in case (nm,mm) of                                   (Just n4,Just m4) -> if (m4 `rem` 7) < (n4 `rem` 7) then (n4 `rem` 7 + 1, m4 `rem` 7 + 1) else (0,0)                                   _ -> (0,0)-     !lstW = any (== "+b") args000-     !args0 = takeWhile (/= "+m") args00 `mappend` drop 1 (dropWhile (/= "-m") args00)-     !multiples = drop 1 . dropWhile (/= "+m") . takeWhile (/= "-m") $ args00 -- Arguments for multiple metrices mode+     !lstW = oneA "+b" argsA+     !args0 = snd . takeCs1R fstCharsM cSpecs1 $ args00+     !multiples = getC "+m" argsC1 -- Arguments for multiple metrices mode      !args = filter (\xs -> all (/= ':') xs && all (/= '@') xs) args0      !coeffs = readCF . concat . take 1 $ args-     !coeffsWX = readCF . drop 2 . concat . take 1 . filter (\ts -> take 2 ts == "+x") $ args000+     !coeffsWX = readCF . concat . getB "+x" $ argsB      !lInes = filter (any (== ':')) args0      !numbersJustPrint =  filter (== "@n") args0      (!wrs, !ks, !arr, !gs, !js, !vs, !ysss, !xs) = innerProcessmentSimple fileGWrSys controlFile segmentRulesFile concatenationsFileP@@ -103,7 +108,7 @@    generalProc pairwisePermutations (gr1,gr2) wrs ks arr gs h qs ysss xs js vs {- the old arguments follow -} lstW multiples lInes coeffs coeffsWX file gzS printLine toOneLine choice   else do    contents <- readFile file-   fLinesNIO (if pairwisePermutations then 10 else 7) ysss xs js vs contents+   fLinesNIO (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs contents  else do   let !file = concat . take 1 $ args   if null numbersJustPrint then do@@ -114,4 +119,25 @@    generalProc pairwisePermutations (gr1,gr2) wrs ks arr gs h qs ysss xs js vs {- the old arguments follow -} lstW multiples lInes coeffs coeffsWX file gzS printLine toOneLine choice   else do    contents <- readFile file-   fLinesNIO (if pairwisePermutations then 10 else 7) ysss xs js vs contents+   fLinesNIO (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs contents++aSpecs :: CLSpecifications+aSpecs = [("+b",0)]++aSpcs :: [String] -> Args+aSpcs = fst . takeAsR aSpecs++cSpecs1 :: CLSpecifications+cSpecs1 = [("+m",-1)]++fstCharsM :: FirstChars+fstCharsM = ('+','-')++bSpecs :: CLSpecifications+bSpecs = zip ["+g","+x","+p"] . cycle $ [1]++bSpcs :: [String] -> Args+bSpcs = fst . takeBsR bSpecs++specs1 :: CLSpecifications+specs1 = aSpecs `mappend` bSpecs `mappend` cSpecs1
Phonetic/Languages/General/GetTextualInfo.hs view
@@ -4,7 +4,7 @@  -- | -- Module      :  Phonetic.Languages.General.GetTextualInfo--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -42,6 +42,7 @@ import Phonetic.Languages.Simplified.StrictVG.Base import Phonetic.Languages.Permutations.Arr import Phonetic.Languages.Permutations.ArrMini+import Phonetic.Languages.Permutations.ArrMini1 import Phonetic.Languages.Simplified.DataG.Base import Phonetic.Languages.Simplified.Array.General.FuncRep2RelatedG2 import Languages.UniquenessPeriods.Array.Constraints.Encoded@@ -49,9 +50,10 @@ import Phonetic.Languages.General.Common import Data.Phonetic.Languages.Base import Data.Phonetic.Languages.Syllables+import qualified Phonetic.Languages.Permutations.Represent as R  generalProc- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> (Int,Int) -- ^ Argument to specify possible 'line growing'.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon@@ -94,14 +96,14 @@  | null lInes = do     contents <- readFile file     let !flines-           | gr1 == 0 = fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs toOneLine contents-           | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs toOneLine $ contents+           | gr1 == 0 = fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs toOneLine contents+           | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs toOneLine $ contents     getData3 pairwisePermutations wrs ks arr gs js vs h rs lstW coeffs coeffsWX (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines  | otherwise = do     contents <- readFile file     let !flines-           | gr1 == 0 = fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs toOneLine . unlines . linesFromArgsG lInes . fLines ysss xs js vs 0 $ contents-           | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs toOneLine . unlines . linesFromArgsG lInes . fLines ysss xs js vs 0 $ contents+           | gr1 == 0 = fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs toOneLine . unlines . linesFromArgsG lInes . fLines ysss xs js vs 0 $ contents+           | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs toOneLine . unlines . linesFromArgsG lInes . fLines ysss xs js vs 0 $ contents     getData3 pairwisePermutations wrs ks arr gs js vs h rs lstW coeffs coeffsWX (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines  linesFromArgs1@@ -118,7 +120,7 @@ linesFromArgsG xss yss = let n = length yss in concatMap (\ts -> linesFromArgs1 n ts yss) xss  getData3- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ 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.@@ -151,7 +153,13 @@  -> [String]  -> [String]  -> IO ()-getData3 pairwisePermutations wrs ks arr gs js vs h rs lstW coeffs coeffsWX gz printLine choice multiples3 zss = let !permsV4 = if pairwisePermutations then genPairwisePermutationsArrLN 10 else genPermutationsArrL in putStrLn (replicate (length multiples3 + 1) '\t' `mappend` show gz) >> mapM_ (process1Line wrs ks arr gs js vs h rs lstW coeffs coeffsWX gz printLine choice multiples3 permsV4) zss+getData3 pairwisePermutations wrs ks arr gs js vs h rs lstW coeffs coeffsWX gz printLine choice multiples3 zss =+  let !permsV4 = case pairwisePermutations of+        R.P 2 -> genPairwisePermutationsArrLN 10+        R.P 1 -> genElementaryPermutationsArrLN1 10+        _ -> genPermutationsArrL in do+          putStrLn (replicate (length multiples3 + 1) '\t' `mappend` show gz)+          mapM_ (process1Line wrs ks arr gs js vs h rs lstW coeffs coeffsWX gz printLine choice multiples3 permsV4) zss  process1Line  :: GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.
Phonetic/Languages/General/Lines.hs view
@@ -4,7 +4,7 @@  -- | -- Module      :  Phonetic.Languages.General.Lines--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -28,6 +28,7 @@ import Phonetic.Languages.Simplified.StrictVG.Base import Phonetic.Languages.Permutations.Arr import Phonetic.Languages.Permutations.ArrMini+import Phonetic.Languages.Permutations.ArrMini1 import Phonetic.Languages.Filters (unsafeSwapVecIWithMaxI) import Text.Read (readMaybe) import Data.Maybe (fromMaybe)@@ -40,13 +41,14 @@ import Data.Monoid (mappend) import Phonetic.Languages.General.Common import Interpreter.StringConversion+import qualified Phonetic.Languages.Permutations.Represent as R  {-| @ since 0.12.0.0 -- Changed the arguments. Now it can run multiple rewritings for the one given data file on the given list of choices for the properties given as the second ['String'] argument. Every new file is being saved with the choice prefix. -} generalProcessment- :: Bool  -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> (Int,Int) -- ^ Argument to specify possible 'line growing'.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ The pairs of the 'Char' that corresponds to the similar phonetic languages consonant phenomenon@@ -74,11 +76,12 @@ generalProcessment pairwisePermutations (gr1,gr2) wrs ks arr gs h rs ysss xs js vs coeffs numericArgs choices numberI file = do   contents <- readFile file   let !permsV-        | pairwisePermutations = genPairwisePermutationsArrLN 10+        | pairwisePermutations == R.P 2 = genPairwisePermutationsArrLN 10+        | pairwisePermutations == R.P 1 = genElementaryPermutationsArrLN1 10         | otherwise = genPermutationsArrL       !flines-        | gr1 == 0 = fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs 0 contents-        | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations then 10 else 7) ysss xs js vs 0 $ contents+        | gr1 == 0 = fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs 0 contents+        | otherwise = prepareGrowTextMN gr1 gr2 ysss xs . unlines . fLinesN (if pairwisePermutations /= R.P 0 then 10 else 7) ysss xs js vs 0 $ contents       !lasts = map (\ts -> if null . words $ ts then [] else last . words $ ts) flines   if compare numberI 2 == LT then     mapM_ (\choice -> toFileStr (choice ++ "." ++ file ++ ".new.txt") (circle2 wrs ks arr gs js vs h rs coeffs permsV choice [] $ flines)) choices
Phonetic/Languages/General/Lines/Parsing.hs view
@@ -4,7 +4,7 @@  -- | -- Module      :  Phonetic.Languages.General.Lines.Parsing--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -28,7 +28,11 @@ import Data.Phonetic.Languages.Base import Data.Phonetic.Languages.Syllables import Data.Phonetic.Languages.SpecificationsRead-import Phonetic.Languages.General.Simple.Parsing+import Phonetic.Languages.General.Simple.Parsing (innerProcessmentSimple)+import CLI.Arguments+import CLI.Arguments.Parsing+import CLI.Arguments.Get+import qualified Phonetic.Languages.Permutations.Represent as R  -- | The function allows to rewrite the phonetic language text in the file given as the first command line argument to a new file. In between, it is rewritten -- so that every last word on the lines is preserved at its position, and the rest of the line is rearranged using the specified other command line@@ -59,16 +63,17 @@  -> IO () argsToLinePrepare h qs = do  args50 <- getArgs- let args000 = filter (/= "+p") args50-     pairwisePermutations = any (== "+p") args50-     multiple = if null . filter (== "+m") $ args000 then 0 else 1-     args00-       | multiple == 1 = takeWhile (/= "+m") args000 `mappend` drop 1 (dropWhile (/= "-m") args000)-       | otherwise = args000+ let (argsA,argsB,argsC1,argss) = args2Args31R fstCharsM specs1 args50+     (prWP,args000) = takeBsR [("+p",1)] args50+     pairwisePermutations = R.bTransform2Perms . getB "+p" $ prWP+     multiple+       | null argsC1 = 0+       | otherwise = 1+     args00 = snd . takeCs1R fstCharsM cSpecs1 $ args000      coeffs = readCF . concat . take 1 $ args00 -- The first command line argument. If not sure, pass just \"1_\".-     compare2 = (\xs -> if null xs then False else True) . filter (== "+c") $ args00+     compare2 = oneA "+c" argsA  if compare2 then do-   let args1 = filter (\xs -> xs /= "+c" && take 2 xs /= "+g") args00+   let args1 = snd . takeAsR [("+c",0)] . snd . takeBsR [("+g",1)] $ args00        (args2,file3)          | null args1 = ([],[])          | otherwise = (init . nub $ args1,last args1)@@ -78,12 +83,12 @@        compareFilesToOneCommon args2 file3    else compareFilesToOneCommon args2 file3  else do-  let growing = filter ((== "+g") . (take 2)) args00+  let growing = concat . getB "+g" $ argsB       (gr1,gr2)             | null growing = (0,0)-            | otherwise = let (nms,mms) = splitAt 1 . drop 2 . take 4 $ growing-                              nm = readMaybe (concat nms)::Maybe Int-                              mm = readMaybe (concat mms)::Maybe Int in case (nm,mm) of+            | otherwise = let (nms,mms) = splitAt 1 growing+                              nm = readMaybe nms::Maybe Int+                              mm = readMaybe mms::Maybe Int in case (nm,mm) of                                   (Just n4,Just m4) -> if (m4 `rem` 7) < (n4 `rem` 7) then (n4 `rem` 7 + 1, m4 `rem` 7 + 1) else (0,0)                                   _ -> (0,0)       args0 = drop 5 args000@@ -103,15 +108,33 @@   -> IO (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, String, [String], [String], Int, FilePath) files4Processment fileGWrSys controlFile segmentRulesFile concatenationsFileP multiple args0 = do   [controlConts, gwrsCnts, segmentData, concatenationsFile] <- mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP]-  let args00-       | multiple == 1 = takeWhile (/= "+m") args0 `mappend` drop 1 (dropWhile (/= "-m") args0)-       | otherwise = args0-      !args1 = filter (\xs -> take 2 xs /= "+g") args00+  let (choices,args00)+       | multiple == 1 = (\(rs,js) -> (getC "+m" rs,js)) . takeCs1R fstCharsM cSpecs1 $ args0+       | otherwise = (drop 1 . take 2 . snd . takeBsR [("+g",1)] $ args0,args0)+      !args1 = snd . takeBsR [("+g",1)] $ args00       !numericArgs = filter (all isDigit) args1-      !choices-         | multiple == 1 = drop 1 . dropWhile (/= "+m") . takeWhile (/= "-m") $ args0-         | otherwise = drop 1 . take 2 . filter (\xs -> take 2 xs /= "+g") $ args0       !numberI = fromMaybe 1 (readMaybe (concat . take 1 $ numericArgs)::Maybe Int)       !file = concat . take 1 $ args0       (wrs, ks, arr, gs, js, vs, ysss, xs) = innerProcessmentSimple gwrsCnts controlConts segmentData concatenationsFile         in return (wrs, ks, arr, gs, js, vs, ysss, xs, numericArgs, choices, numberI, file)++aSpecs :: CLSpecifications+aSpecs = [("+c",0)]++aSpcs :: [String] -> Args+aSpcs = fst . takeAsR aSpecs++cSpecs1 :: CLSpecifications+cSpecs1 = [("+m",-1)]++fstCharsM :: FirstChars+fstCharsM = ('+','-')++bSpecs :: CLSpecifications+bSpecs = zip ["+d","+g","+p"] . cycle $ [1]++bSpcs :: [String] -> Args+bSpcs = fst . takeBsR bSpecs++specs1 :: CLSpecifications+specs1 = aSpecs `mappend` bSpecs `mappend` cSpecs1
Phonetic/Languages/General/Simple.hs view
@@ -4,7 +4,7 @@  -- | -- Module      :  Phonetic.Languages.General.Simple--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -31,6 +31,7 @@ import Phonetic.Languages.Simplified.Array.General.FuncRep2RelatedG2 import Phonetic.Languages.Permutations.Arr import Phonetic.Languages.Permutations.ArrMini+import Phonetic.Languages.Permutations.ArrMini1 import Data.SubG hiding (takeWhile,dropWhile) import Data.Maybe import Data.MinMax.Preconditions@@ -40,6 +41,7 @@ import Phonetic.Languages.General.Common import Data.Phonetic.Languages.Syllables import Interpreter.StringConversion+import qualified Phonetic.Languages.Permutations.Represent as R   forMultiplePropertiesF :: [String] -> [(String,[String])]@@ -53,7 +55,7 @@ {-| Is used to organize the most complex processment -- for multiple sources and probably recursively. -} generalProc3G- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> (String -> Bool) -- ^ The predicate that checks whether the given argument is not a phonetic language word in the representation.  -> [String]  -> String -- ^ If empty, the function is just 'generalProc2G' with the arguments starting from the first 'Bool' here.@@ -96,7 +98,7 @@  | otherwise =       mapM_ (\js -> do         let !kss = lines js-        if pairwisePermutations then do+        if pairwisePermutations /= R.P 0 then do           let !wss                 | textProcessment1 `elem` [10,20,30,40,50,60,70,80,90] = kss                 | otherwise = prepareTuneTextMN m 1 ysss ws . unwords $ kss@@ -114,7 +116,7 @@  -- | Is used to do general processment. generalProc2G- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ 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.@@ -159,7 +161,7 @@  -- | generalProc2-  :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+  :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.   -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.   -> [(Char,Char)] -- ^ 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.@@ -190,7 +192,7 @@   let !argMss = take 5 . filter (not . null) . forMultiplePropertiesF . drop 1 . dropWhile (/= "+m") . takeWhile (/= "-m") $ args0   if null argMss then do    let (!numericArgs,!textualArgs) = L.span (all isDigit) $ args-       !xs = concat . take 1 . prepareTuneTextMN (if pairwisePermutations then 10 else 7) 1 ysss ws . unwords . drop 1 $ textualArgs+       !xs = concat . take 1 . prepareTuneTextMN (if pairwisePermutations /= R.P 0 then 10 else 7) 1 ysss ws . unwords . drop 1 $ textualArgs        !l = length . words $ xs        !argCs = catMaybes (fmap (readMaybeECG (l - 1)) . (showB l lstW2:) . drop 1 . dropWhile (/= "+a") .           takeWhile (/= "-a") $ args0)@@ -224,7 +226,7 @@          (\zs -> if null zs then [numberI] else L.nub zs) . L.sort . filter (<= numberI) .            map (\t -> fromMaybe numberI $ (readMaybe t::Maybe Int)) . drop 2 $ us) $ numericArgss        !argsZipped = L.zip4 intervalNmbrss arg0s numberIs choices-       !xs = concat . take 1 . prepareTuneTextMN (if pairwisePermutations then 10 else 7) 1 ysss ws . unwords $ args+       !xs = concat . take 1 . prepareTuneTextMN (if pairwisePermutations /= R.P 0 then 10 else 7) 1 ysss ws . unwords $ args        !l = length . words $ xs        !argCs = catMaybes (fmap (readMaybeECG (l - 1)) . (showB l lstW2:) . drop 1 . dropWhile (/= "+a") .           takeWhile (/= "-a") $ args0)@@ -236,13 +238,14 @@    else do     let !subs = subG (' ':js `mappend` vs) xs     if null argCs then let !perms-                             | pairwisePermutations = genPairwisePermutationsLN l+                             | pairwisePermutations == R.P 2 = genPairwisePermutationsLN l+                             | pairwisePermutations == R.P 1 = genElementaryPermutationsLN1 l                              | otherwise = genPermutationsL l in       generalProcMMs pairwisePermutations wrs ks arr gs js vs h qs ysss ws recursiveMode interactive jstL0 args0 coeffs coeffsWX argsZipped perms subs args lstW2     else do      correct <- printWarning xs      if correct == "n" then putStrLn (messageInfo 1) >> return "" -- for the multiple variations mode (with curly brackets and slash in the text) the program does not stop here, but the variation is made empty and is proposed further as a variant.-     else let !perms = decodeLConstraints argCs . (if pairwisePermutations then genPairwisePermutationsLN else genPermutationsL) $ l in+     else let !perms = decodeLConstraints argCs . (case pairwisePermutations of {R.P 2 -> genPairwisePermutationsLN ; R.P 1 -> genElementaryPermutationsLN1 ; ~rrr -> genPermutationsL}) $ l in             generalProcMMs pairwisePermutations wrs ks arr gs js vs h qs ysss ws recursiveMode interactive jstL0 args0 coeffs coeffsWX argsZipped perms subs args lstW2  -- | Function provides message information.@@ -275,7 +278,7 @@       putStrLn ts >> return ts  interactivePrintResultRecursive- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ 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.@@ -321,7 +324,7 @@        let strIntrpr = convStringInterpreter stringInterpreted ts            !firstArgs = takeWhile (not . all isLetter) args        wordsNN <--         if pairwisePermutations then do+         if pairwisePermutations /= R.P 0 then do            putStrLn . messageInfo $ 8            mStr <- getLine            let m = fromMaybe 10 (readMaybe mStr::Maybe Int) in return . take m . words $ strIntrpr@@ -380,7 +383,7 @@  -- | generalProcMMs- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ 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.@@ -433,7 +436,7 @@  -- | finalProc- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.  -> [(Char,Char)] -- ^ 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.
Phonetic/Languages/General/Simple/Parsing.hs view
@@ -1,6 +1,6 @@ -- | -- Module      :  Phonetic.Languages.General.Simple.Parsing--- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- Copyright   :  (c) OleksandrZhabenko 2020-2022 -- License     :  MIT -- Stability   :  Experimental -- Maintainer  :  olexandr543@yahoo.com@@ -26,6 +26,10 @@ import Data.Maybe (fromMaybe) import Data.Phonetic.Languages.SpecificationsRead import Interpreter.StringConversion (readFileIfAny)+import CLI.Arguments+import CLI.Arguments.Parsing+import CLI.Arguments.Get+import qualified Phonetic.Languages.Permutations.Represent as R  -- | Prints the rearrangements with the \"property\" information for the phonetic language text. -- Most of the arguments are obtained from the 'getArgs' function.@@ -48,10 +52,10 @@ -- values of the metrics interval using the 'unsafeSwapVecIWithMaxI' function. The first textual command line argument should be in the form either \"y0\", -- or \"0y\", or \"yy\", or \"y\", or \"02y\", or \"y2\", or \"03y\", or \"yy2\", or \"y3\", or some other variant and specifies, which property or properties is or are evaluated. -- The rest of the command line arguments is the phonetic text. Besides, you can use multiple metrices (no more than 5 different ones) together by--- using \"+M\" ... \"-M\" command line arguments.+-- using \"+m\" ... \"-m\" command line arguments. -- -- You can specify constraints according to the 'decodeLConstraints' function between +A and -A next command line arguments. If so, the program will--- ask you additional question before proceeding. The \"+M\" ... \"-M\" and \"+A\" ... \"-A\" groups must not mutually intersect one another.+-- ask you additional question before proceeding. The \"+m\" ... \"-m\" and \"+a\" ... \"-a\" groups must not mutually intersect one another. argsToSimplePrepare  :: (Double -> String -> ([[[PRS]]] -> [[Double]])) -- ^ The function that is needed in the 'procRhythmicity23F' function.  -- Specifies a way how the syllables represented in the phonetic language approach transforms into their durations and@@ -64,14 +68,17 @@  -> IO () argsToSimplePrepare h qs p = do  args50 <- getArgs- let args00000 = filter (/= "+p") args50-     pairwisePermutations = any (== "+p") args50-     args0000 = filter (not . null) (takeWhile (\xs -> take 2 xs /= "*t") args00000 `mappend` (drop 1 . dropWhile (\xs -> take 2 xs /= "^t") $ args00000))-     textProcessmentFssFs = drop 1 . dropWhile (\xs -> take 2 xs /= "*t") . takeWhile (\xs -> take 2 xs /= "^t") $ args00000-     textProcessment0 = concat . filter (\xs -> take 2 xs == "*t") $ args00000+ let (argsA,argsB,argsC1,argss) = args2Args31R fstCharsMA specs1 args50+     args00000 = snd . takeBsR [("+p",1)] $ args50+     pairwisePermutations = R.bTransform2Perms . getB "+p" $ argsB+     (txtPFs,args0000F) = takeCs1R fstCharsT cSpecs1T args00000+     textProcessmentFssFs = getC "+t" txtPFs+     textProcessment0+       | null . concat . getB "+t" . fst . takeBsR [("+t",1)] $ args00000 = []+       | otherwise = "+t" `mappend` (concat . getB "+t" . fst . takeBsR [("+t",1)] $ args00000)      textProcessment1 = fromMaybe 70 (readMaybe (drop 2 textProcessment0)::Maybe Int)-     args000 = filter (/= "+r") args0000-     recursiveMode = any (== "+r") args0000 -- Specifies whether to use the interactive recursive mode+     (rcrs,args000) = takeAsR [("+r",0)] . filter (not . null) $ args0000F+     recursiveMode = oneA "+r" rcrs -- Specifies whether to use the interactive recursive mode      (!args14,!args00) = splitAt 4 args000      [fileGWrSys, controlFile, segmentRulesFile, concatenationsFileP] = args14  (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, coeffsWX, args, lstW) <- argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP args00@@ -85,7 +92,7 @@ -- respectively and the last argument the 'String' with all the other specifications. If it is not proper, -- the functions returns an error. argsToSimplePrepare4Files- :: Bool -- ^ Whether to use just pairwise permutations, or the full universal set.+ :: R.PermutationsType -- ^ Whether to use just one of the express permutations, or the full universal set.  -> FilePath -- ^ With the 'GWritingSystemPRPLX' specifications only (see the gwrsysExample.txt file in the @phonetic-languages-phonetics-basics@ package as a schema);  -> FilePath -- ^ With the 5 meaningful lines that are delimited with the \'~\' line one from another with the specifications for the possible allophones (if any), 'CharPhoneticClassification', white spaces information (two 'String's) and the 'String' of all the possible 'PLL' 'Char's;  -> FilePath -- ^ With the 'SegmentRulesG' specifications only;@@ -104,10 +111,9 @@  -> Int  -> IO () argsToSimplePrepare4Files pairwisePermutations fileGWrSys controlFile segmentRulesFile concatenationsFileP h qs other_args p textProcessmentFss textProcessment0 textProcessment1 = do- let args0000 = words other_args-     args000 = drop 4 args0000-     args00 = filter (/= "+r") args000-     recursiveMode = any (== "+r") args000 -- Specifies whether to use the interactive recursive mode+ let args000 = drop 4 . words $ other_args+     (rcs,args00) = takeAsR [("+r",0)] args000+     recursiveMode = oneA "+r" rcs -- Specifies whether to use the interactive recursive mode  (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, coeffsWX, args, lstW) <- argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP args00  let (wrs, ks, arr, gs, js, vs, ysss, ws) = innerProcessmentSimple gwrsCnts controlConts segmentData concatenationsFile  if isPair coeffs then generalProc3G pairwisePermutations p textProcessmentFss textProcessment0 textProcessment1 wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW@@ -142,18 +148,44 @@  -> [String] -- ^ List of other args afterwards.  -> IO (String, String, String, String, String, Bool, Bool, [String], Coeffs2, Coeffs2, [String], Bool) argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP args00 = do- let args0 = filter (\xs -> take 2 xs /= "+x" && xs /= "+b" && xs /= "+l" && xs /= "+bl" && xs /= "+i" && xs /= "+u") args00-     lstW = if any (\x -> x == "+b" || x == "+bl") args00 then True else False -- If one of the command line options is \"+b\" or \"+bl\" then the last word of the line will remain the last one.-     jstL0 = if any (\x -> x == "+l" || x == "+bl") args00 then True else False -- If one of the command line options is \"+l\" or \"+bl\" then the program outputs just lines without metrices values.-     toFileMode1 = concat . take 1 . drop 1 . dropWhile (/= "+f") $ args0  -- Prints the last resulting line of the interactive mode processment (the last selected variant) to the file and also to the stdout.-     interactiveP = if any (\xs -> xs == "+i" || xs == "+f") args00 then True else False -- If one of the command line options is \"+i\", or \"+f\" then the program prints the variants and then prompts for the preferred variant. Afterwards, it prints just that variant alone.-     args01 = takeWhile (/= "+a") args0 `mappend` (drop 1 . dropWhile (/= "-a") $ args0)+ let args0 = snd . takeBsR [("+x",1)] . snd . takeAsR (zip ["+b","+l","+bl","+i"] . cycle $ [0]) $ args00+     lstW = any (\x -> x == "+b" || x == "+bl") args00 -- If one of the command line options is \"+b\" or \"+bl\" then the last word of the line will remain the last one.+     jstL0 = any (\x -> x == "+l" || x == "+bl") args00 -- If one of the command line options is \"+l\" or \"+bl\" then the program outputs just lines without metrices values.+     toFileMode1 = concat . getB "+f" . bSpcs $ args0  -- Prints the last resulting line of the interactive mode processment (the last selected variant) to the file and also to the stdout.+     interactiveP = any (== "+i") args00 || not (null toFileMode1) -- If one of the command line options is \"+i\", or \"+f\" then the program prints the variants and then prompts for the preferred variant. Afterwards, it prints just that variant alone.+     args01 = snd . takeCs1R fstCharsMA [("+a",-1)] $ args0      args02       | null toFileMode1 = filter (/= "+f") args01-      | otherwise = let (krs,lrs) = break (== "+f") args01-                        mrs = drop 2 lrs in krs `mappend` mrs-     args = takeWhile (/= "+m") args02 `mappend` (drop 1 . dropWhile (/= "-m") $ args02)+      | otherwise = snd . takeBsR [("+f",1)] $ args01+     args = snd . takeCs1R fstCharsMA [("+m",-1)] $ args02      coeffs = readCF . concat . take 1 $ args-     coeffsWX = readCF . drop 2 . concat . take 1 . filter (\ts -> take 2 ts == "+x") $ args00+     coeffsWX = readCF . concat . getB "+x" . fst . takeBsR [("+x",1)] $ args00  [controlConts, gwrsCnts, segmentData, concatenationsFile] <- mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP]  return (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, coeffsWX, args, lstW)++aSpecs :: CLSpecifications+aSpecs = zip ["+r","+b","+l","+bl","+i"] . cycle $ [0]++aSpcs :: [String] -> Args+aSpcs = fst . takeAsR aSpecs++cSpecs1MA :: CLSpecifications+cSpecs1MA = zip ["+m","+a"] . cycle $ [-1]++fstCharsMA :: FirstChars+fstCharsMA = ('+','-')++cSpecs1T :: CLSpecifications+cSpecs1T = [("+t",-1)]++fstCharsT :: FirstChars+fstCharsT = ('+','^')++bSpecs :: CLSpecifications+bSpecs = zip ["+d","+f","+p"] . cycle $ [1]++bSpcs :: [String] -> Args+bSpcs = fst . takeBsR bSpecs++specs1 :: CLSpecifications+specs1 = aSpecs `mappend` bSpecs `mappend` cSpecs1MA
README.md view
@@ -75,14 +75,22 @@  Since the 0.5.0.0 version you can use also "w" and "x" series (lines) of properties. They use more complex approach and are intended for 4 elements in the rhythmic groups. For more information, please, refer to the-section 'WX argument' in the English instruction:+section 'WX argument' in the Ukrainian instruction: -https://oleksandrzhabenko.github.io/uk/InstructionEng.13.1.pdf+https://oleksandrzhabenko.github.io/uk/InstructionUkr.16.pdf  or here: -http://web.archive.org/web/20211023172024/https://oleksandrzhabenko.github.io/uk/InstructionEng.13.1.pdf+(try https://web.archive.org/save/https://oleksandrzhabenko.github.io/uk/InstructionUkr.16.pdf) +The instruction in English is here:++https://oleksandrzhabenko.github.io/uk/InstructionEng.16.pdf++or here:++(try https://web.archive.org/save/https://oleksandrzhabenko.github.io/uk/InstructionEng.16.pdf)+ There are also some additional information there about the changes in the 0.6.0.0 version.  Since the 0.6.0.0 version there are made several significant changes.@@ -106,3 +114,9 @@ mode (with +p command line argument) where just pairwise permutations are used and the length of the line can be up to 10 words or their concatenations.++Since the 0.14.0.0 version you can use two reduced set of permutations modes+in addition to the default full universal set of permutations mode. To+use them, please, add "+p {1 or 2}" to the command line arguments.+For more information, please, refer to the instructions following the links+above.
phonetic-languages-simplified-generalized-examples-array.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-simplified-generalized-examples-array-version:             0.13.1.0+version:             0.14.0.0 synopsis:            Helps to create texts with the given phonetic properties (e. g. poetic). description:         Is rewritten from the modules of the @phonetic-languages-simplified-examples-array@ package. Can be used not only for Ukrainian, but also for other languages. homepage:            https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-examples-array@@ -21,6 +21,6 @@   exposed-modules:     Phonetic.Languages.General.Lines, Phonetic.Languages.General.Parsing, Phonetic.Languages.General.Simple, Phonetic.Languages.General.GetTextualInfo, Phonetic.Languages.Simplified.Array.General.FuncRep2RelatedG2, Phonetic.Languages.General.Simple.Parsing, Phonetic.Languages.General.Lines.Parsing, Phonetic.Languages.General.GetInfo.Parsing, EspeakNG_IPA   -- other-modules:   other-extensions:    BangPatterns, FlexibleContexts-  build-depends:       base >=4.8 && <4.16, phonetic-languages-simplified-generalized-examples-common >=0.3 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.8.2 && <1, phonetic-languages-simplified-base >=0.3 && <1, phonetic-languages-permutations-array >=0.2 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-phonetics-basics >=0.8.4 && <1, phonetic-languages-constraints-array >=0.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.5.1 && <1, mmsyn2-array >=0.1.3 && <1, heaps >=0.3.6.1 && <1, mmsyn3 >=0.1.5 && <1, process >= 1.6.2 && <2, string-interpreter >=0.5.4.1 && <1+  build-depends:       base >=4.8 && <5, phonetic-languages-simplified-generalized-examples-common >=0.3 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.8.5 && <1, phonetic-languages-simplified-base >=0.4.5 && <1, phonetic-languages-permutations-array >=0.3.3 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-phonetics-basics >=0.8.4 && <1, phonetic-languages-constraints-array >=0.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.5.1 && <1, mmsyn2-array >=0.1.3 && <1, heaps >=0.3.6.1 && <1, mmsyn3 >=0.1.5 && <1, process >= 1.6.2 && <2, string-interpreter >=0.5.4.1 && <1, cli-arguments >=0.6 && <1   -- hs-source-dirs:   default-language:    Haskell2010