packages feed

phonetic-languages-simplified-generalized-examples-array 0.1.1.0 → 0.2.0.0

raw patch · 6 files changed

+353/−5 lines, 6 filesdep ~phonetic-languages-phonetics-basicsdep ~phonetic-languages-simplified-generalized-examples-commondep ~phonetic-languages-simplified-generalized-properties-arrayPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: phonetic-languages-phonetics-basics, phonetic-languages-simplified-generalized-examples-common, phonetic-languages-simplified-generalized-properties-array

API changes (from Hackage documentation)

+ Phonetic.Languages.General.GetInfo.Parsing: argsToGetInfoProcessment :: (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> IO ()
+ Phonetic.Languages.General.GetInfo.Parsing: files4ArgsProcessment :: FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> [String] -> IO ()
+ Phonetic.Languages.General.Lines.Parsing: argsToLinePrepare :: (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> IO ()
+ Phonetic.Languages.General.Lines.Parsing: files4Processment :: FilePath -> FilePath -> FilePath -> FilePath -> [String] -> IO (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, String, [String], String, Int, FilePath)
+ Phonetic.Languages.General.Simple.Parsing: argsProcessment :: FilePath -> FilePath -> FilePath -> FilePath -> [String] -> IO (String, String, String, String, String, Bool, Bool, [String], Coeffs2, [String], Bool)
+ Phonetic.Languages.General.Simple.Parsing: argsToSimplePrepare :: (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> IO ()
+ Phonetic.Languages.General.Simple.Parsing: argsToSimplePrepare4Files :: FilePath -> FilePath -> FilePath -> FilePath -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> String -> IO ()
+ Phonetic.Languages.General.Simple.Parsing: innerProcessmentSimple :: String -> String -> String -> String -> (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, String)

Files

ChangeLog.md view
@@ -11,3 +11,8 @@ ## 0.1.1.0 -- 2021-05-10  * First version revised B. Some documentation improvements. Changed the dependencies boundaries.++## 0.2.0.0 -- 2021-05-24++* Second version. Added new modules: Phonetic.Languages.General.Simple.Parsing, Phonetic.Languages.General.Lines.Parsing,+Phonetic.Languages.General.GetInfo.Parsing. Added README.md file with some remarks to the new modules. 
+ Phonetic/Languages/General/GetInfo/Parsing.hs view
@@ -0,0 +1,105 @@+-- |+-- Module      :  Phonetic.Languages.General.GetInfo.Parsing+-- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+-- Can be used to analyze a poetic text in a phonetic language, for every line printing statistic data.+--++{-# OPTIONS_GHC -threaded #-}+{-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE BangPatterns, FlexibleContexts #-}++module Phonetic.Languages.General.GetInfo.Parsing where++import Phonetic.Languages.General.GetTextualInfo+import Data.Maybe (fromMaybe)+import Text.Read (readMaybe)+import System.Environment (getArgs)+import Data.Monoid (mappend)+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.Array.General.PropertiesSyllablesG2+import Phonetic.Languages.General.Simple+import Data.Phonetic.Languages.SpecificationsRead++-- | 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);+--+-- 2) 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;+--+-- 3) with the 'SegmentRulesG' specifications only;+--+-- 4) with the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+--+argsToGetInfoProcessment+  :: (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+ -- depends on two parameters. Is specific for every phonetic language and every representation, so must be provided+ -- by the user in every case. The example of the function can be found in the package @phonetic-languages-simplified-properties-array@.+ -> [([[[PRS]]] -> [[Double]])] -- ^ A list of 4 different functions that specifies the syllables durations, analogues of the+  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most+  -- exact one and, therefore, the default one.+ -> IO ()+argsToGetInfoProcessment h qs = do+ args40 <- getArgs+ let (!args14,!args000) = splitAt 4 args40+     [fileGWrSys, controlFile, segmentRulesFile, concatenationsFileP] = args14+ files4ArgsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP h qs args000++files4ArgsProcessment+  :: 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;+  -> FilePath -- ^ With the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+  -> (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+  -- depends on two parameters. Is specific for every phonetic language and every representation, so must be provided+  -- by the user in every case. The example of the function can be found in the package @phonetic-languages-simplified-properties-array@.+  -> [([[[PRS]]] -> [[Double]])] -- ^ A list of 4 different functions that specifies the syllables durations, analogues of the+  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most+  -- exact one and, therefore, the default one.+  -> [String] -- ^ List of other command line arguments+  -> IO ()+files4ArgsProcessment !fileGWrSys !controlFile !segmentRulesFile !concatenationsFileP h qs args000 = do+ let !args00 = filter (/= "++B") args000+     !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+     !args = filter (\xs -> all (/= ':') xs && all (/= '@') xs) args0+     !coeffs = readCF . concat . take 1 $ args +     !lInes = filter (any (== ':')) args0+     !numbersJustPrint =  filter (== "@n") args0+     (!wrs, !ks, !arr, !gs, !js, !vs, !ysss, !xs) = innerProcessmentSimple fileGWrSys controlFile segmentRulesFile concatenationsFileP+ if isPair coeffs then do+  let !file = concat . drop 1 . take 2 $ args  +  if null numbersJustPrint then do+   let !gzS = concat . take 1 . drop 2 $ args +       !printLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 3 $ args)::(Maybe Int))+       !toOneLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 4 $ args)::(Maybe Int))+       !choice = concat . drop 5 . take 6 $ args +   generalProc wrs ks arr gs h qs ysss xs js vs {- the old arguments follow -} lstW multiples lInes coeffs file gzS printLine toOneLine choice+  else do+   contents <- readFile file+   fLinesIO ysss xs js vs contents + else do+  let !file = concat . take 1 $ args+  if null numbersJustPrint then do+   let !gzS = concat . take 1 . drop 1 $ args+       !printLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 2 $ args)::(Maybe Int))+       !toOneLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 3 $ args)::(Maybe Int))+       !choice = concat . drop 4 . take 5 $ args+   generalProc wrs ks arr gs h qs ysss xs js vs {- the old arguments follow -} lstW multiples lInes coeffs file gzS printLine toOneLine choice+  else do+   contents <- readFile file+   fLinesIO ysss xs js vs contents
+ Phonetic/Languages/General/Lines/Parsing.hs view
@@ -0,0 +1,90 @@+{-# OPTIONS_GHC -threaded -rtsopts #-}+{-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE BangPatterns #-}++-- |+-- Module      :  Phonetic.Languages.General.Lines.Parsing+-- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+-- Inspired by: https://functional-art.org/2020/papers/Poetry-OleksandrZhabenko.pdf from the https://functional-art.org/2020/performances ;+-- Allows to rewrite the given text (usually a poetic one).++module Phonetic.Languages.General.Lines.Parsing where++import Phonetic.Languages.Array.General.PropertiesSyllablesG2+import Text.Read (readMaybe)+import Data.Maybe (fromMaybe)+import System.Environment (getArgs)+import Data.Char (isDigit)+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++-- | 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+-- arguments. They are general for the whole program. The first command line argument is a 'FilePath' to the file with a phonetic text to be rewritten.+-- The second one is a variant of the \"properties\" used to evaluate the variants.+-- The further command line arguments are: the number of the intervals and the numbers of the intervals+-- that are swapped with the maximum one so that they are available for further usage by the program. See documentation for @uniqueness-periods-vector-filters@+-- package+-- 'https://hackage.haskell.org/package/uniqueness-periods-vector-filters'+--+-- (Taken from the https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array-0.4.1.0/docs/Phonetic-Languages-Lines.html+-- from the @phonetic-languages-simplified-examples-array@ package) You can also run program in a \'comparative\' mode by specifying \"+C\" as one of the command line arguments and then+-- three files -- the first two -- the existing ones with probably rewritten text by the program for different arguments+-- and the third one is the resulting file. While running in such a mode the program outputs line-by-line the contents of+-- the two first files and writes one of them (or an empty line if neither one) to the third file.+argsToLinePrepare+ :: (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+ -- depends on two parameters. Is specific for every phonetic language and every representation, so must be provided+ -- by the user in every case. The example of the function can be found in the package @phonetic-languages-simplified-properties-array@.+ -> [([[[PRS]]] -> [[Double]])] -- ^ A list of 4 different functions that specifies the syllables durations, analogues of the+  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most+  -- exact one and, therefore, the default one.+ -> IO ()+argsToLinePrepare h qs = do+ args00 <- getArgs+ let 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+ if compare2 then do+   let args1 = filter (/= "+C") args00+       [file1, file2, file3] = take 3 args1+   if file3 /= file1 && file3 /= file2 then compareFilesToOneCommon file1 file2 file3+   else do+    putStrLn "You specified some files twice being in the comparative mode, the program has no well-defined behaviour in such a mode. "+    putStrLn "Please, run it again and specify the three different arguments with the first two being the existing files. "+ else do+  let args0 = drop 5 args00+      [fileGWrSys, controlFile, segmentRulesFile, concatenationsFileP] = drop 1 . take 5 $ args00 -- To get the valid 'Concatenations' data.+  (wrs, ks, arr, gs, js, vs, ysss, xs, numericArgs, choice, numberI, file) <- files4Processment fileGWrSys controlFile segmentRulesFile concatenationsFileP args0+  generalProcessment wrs ks arr gs h qs ysss xs js vs {- the old arguments afterwards -} coeffs numericArgs choice numberI file++-- | Is used internally in the 'argsToLinePrepare'. Nevertheless, can be used independently if the semantics+-- of the arguments and their structure are preserved.+files4Processment+  :: 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;+  -> FilePath -- ^ With the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+  -> [String] -- ^ List of other command line arguments+  -> IO (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, String, [String], String, Int, FilePath)+files4Processment fileGWrSys controlFile segmentRulesFile concatenationsFileP args0 = do+  [controlConts, gwrsCnts, segmentData, concatenationsFile] <- mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP]+  let !numericArgs = filter (all isDigit) . drop 2 $ args0+      !choice = concat . drop 1 . take 2 $ 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, choice, numberI, file)+ 
+ Phonetic/Languages/General/Simple/Parsing.hs view
@@ -0,0 +1,135 @@+-- |+-- Module      :  Phonetic.Languages.General.Simple.Parsing+-- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+-- Prints the rearrangements with the \"property\" information for the phonetic language text. Is used for the+-- Phonetic.Languages.General.Simple module functionality.++{-# OPTIONS_GHC -threaded #-}+{-# OPTIONS_HADDOCK show-extensions #-}+{-# LANGUAGE BangPatterns #-}++module Phonetic.Languages.General.Simple.Parsing where++import Phonetic.Languages.Array.General.PropertiesSyllablesG2+import Data.Phonetic.Languages.PrepareText+import System.Environment (getArgs)+import Phonetic.Languages.General.Simple+import Data.List (sort)+import GHC.Arr+import Data.Phonetic.Languages.Base+import Data.Phonetic.Languages.Syllables+import Text.Read (readMaybe)+import Data.Maybe (fromMaybe)+import Data.Phonetic.Languages.SpecificationsRead++-- | Prints the rearrangements with the \"property\" information for the phonetic language text.+-- Most of the arguments are obtained from the 'getArgs' function.+-- While used, it distinguishes between two groups of command line arguments: the first four ones and the others afterwards.+-- 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);+--+-- 2) 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;+--+-- 3) with the 'SegmentRulesG' specifications only;+--+-- 4) with the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+--+-- Afterwards, the meaning of the command line arguments are as follows (from the left to the right).+--+-- The first next command line argument must be a+-- positive 'Int' number and is a number of printed variants for the line (if they are present, otherwise just all possible variants are printed).+-- The second one is the number of the intervals into which the all range of possible metrics values are divided. The next numeric arguments that must be+-- sequenced without interruptions further are treated as the numbers of the intervals (counting is started from 1) which values are moved to the maximum+-- 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.+--+-- 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.+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+ -- depends on two parameters. Is specific for every phonetic language and every representation, so must be provided+ -- by the user in every case. The example of the function can be found in the package @phonetic-languages-simplified-properties-array@.+ -> [([[[PRS]]] -> [[Double]])] -- ^ A list of 4 different functions that specifies the syllables durations, analogues of the+  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most+  -- exact one and, therefore, the default one.+ -> IO ()+argsToSimplePrepare h qs = do+ args000 <- getArgs+ let (!args14,!args00) = splitAt 4 args000+     [fileGWrSys, controlFile, segmentRulesFile, concatenationsFileP] = args14+ (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, 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 generalProc2G wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 interactiveP jstL0 args0 coeffs (drop 1 args) lstW+ else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 interactiveP jstL0 args0 coeffs args lstW+ +-- | Similar to the 'argsToSimplePrepare' function, but takes explicitly the four 'FilePath's for the files+-- respectively and the last argument the 'String' with all the other specifications. If it is not proper,+-- the functions returns an error.+argsToSimplePrepare4Files+ :: 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;+ -> FilePath -- ^ With the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+ -> (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+ -- depends on two parameters. Is specific for every phonetic language and every representation, so must be provided+ -- by the user in every case. The example of the function can be found in the package @phonetic-languages-simplified-properties-array@.+ -> [([[[PRS]]] -> [[Double]])] -- ^ A list of 4 different functions that specifies the syllables durations, analogues of the+  -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most+  -- exact one and, therefore, the default one.+ -> String -- ^ A 'String' of data that are the further command line arguments for the function 'argsToSimplePrepare'.+ -> IO ()+argsToSimplePrepare4Files fileGWrSys controlFile segmentRulesFile concatenationsFileP h qs other_args = do+ let args000 = words other_args+     args00 = drop 4 args000+ (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, 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 generalProc2G wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 interactiveP jstL0 args0 coeffs (drop 1 args) lstW+ else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 interactiveP jstL0 args0 coeffs args lstW+ +innerProcessmentSimple+  :: String -- ^ Must be a valid 'GWritingSystemPRPLX' specifications 'String' representation only (see the gwrsysExample.txt file in the @phonetic-languages-phonetics-basics@ package as a schema);+  -> String -- ^ Must be a 'String' 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;+  -> String -- ^ Must be a 'String' with the 'SegmentRulesG' specifications only;+  -> String -- ^ Must be a 'String' with the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+  -> (GWritingSystemPRPLX, [(Char, Char)], CharPhoneticClassification, SegmentRulesG, String, String, Concatenations, String)+innerProcessmentSimple gwrsCnts controlConts segmentData concatenationsFile = + let [allophonesGs, charClfs, jss, vss, wss] = groupBetweenChars '~' . lines $ controlConts+     wrs = getGWritingSystem '~' gwrsCnts+     ks = sort . fromMaybe [] $ (readMaybe (unwords allophonesGs)::Maybe [(Char, Char)])+     arr = read (unwords charClfs)::Array Int PRS -- The 'Array' must be previously sorted in the ascending order.+     gs = read segmentData::SegmentRulesG+     ysss = sort2Concat . fromMaybe [] $ (readMaybe segmentData::Maybe [[String]])+     js = concat jss+     vs = concat vss+     ws = sort . concat $ wss+       in (wrs, ks, arr, gs, js, vs, ysss, ws)++argsProcessment+ :: 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;+ -> FilePath -- ^ With the 'Concatenations' specifications only (see the data in the EnglishConcatenated.txt file in the @phonetic-languages-phonetics-basics@ package as a list of English equivalents of the needed 'String's).+ -> [String] -- ^ List of other args afterwards.+ -> IO (String, String, String, String, String, Bool, Bool, [String], Coeffs2, [String], Bool)+argsProcessment fileGWrSys controlFile segmentRulesFile concatenationsFileP args00 = do+ let args0 = filter (\xs -> 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 (/= "+IF") . takeWhile (/= "-IF") $ 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 == "+IF") args00 then True else False -- If one of the command line options is \"++I\", or \"+IF\" 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)+     args02+      | null toFileMode1 = filter (\xs -> xs /= "+IF" && xs /= "-IF") args01+      | otherwise = takeWhile (/= "+IF") args01 `mappend` (drop 1 . dropWhile (/= "-IF") $ args01)+     args = takeWhile (/= "+M") args02 `mappend` (drop 1 . dropWhile (/= "-M") $ args02)+     coeffs = readCF . concat . take 1 $ args+ [controlConts, gwrsCnts, segmentData, concatenationsFile] <- mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP]+ return (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, args, lstW)
+ README.md view
@@ -0,0 +1,13 @@+The version 0.2.0.0 is prepared to the Day of the Saints Cyril and Methodius, the 'Apostles to the Slavs',+and to the Day of Slavic writing systems and culture. ++The functions in the modules Phonetic.Languages.General.Simple.Parsing, Phonetic.Languages.General.Lines.Parsing,+Phonetic.Languages.General.GetInfo.Parsing highly depend on the data types in the phonetic-languages-phonetics-basics+package.++They use the parsing with the failing possibilities, so for them, to work properly, you need to specify every+piece of data accordingly to the specifications in the imported modules and in the new modules themselves.++Otherwise, the functions definitely will not work correctly.++Are provided for testing purposes, may be not performant for production usage.
phonetic-languages-simplified-generalized-examples-array.cabal view
@@ -3,9 +3,9 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-simplified-generalized-examples-array-version:             0.1.1.0+version:             0.2.0.0 synopsis:            Helps to create texts with the given phonetic properties (e. g. poetic).-description:         Is rewritten from the library modules of the @phonetic-languages-simplified-examples-array@ package. Can be used not only for Ukrainian, but also for other languages. +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 license:             MIT license-file:        LICENSE@@ -14,13 +14,13 @@ copyright:           Oleksandr Zhabenko category:            Language, Math, Game build-type:          Simple-extra-source-files:  ChangeLog.md+extra-source-files:  ChangeLog.md, README.md cabal-version:       >=1.10  library-  exposed-modules:     Phonetic.Languages.General.Lines, Phonetic.Languages.General.Parsing, Phonetic.Languages.General.Simple, Phonetic.Languages.General.GetTextualInfo, Phonetic.Languages.Simplified.Array.General.FuncRep2RelatedG2+  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   -- other-modules:   other-extensions:    BangPatterns, FlexibleContexts-  build-depends:       base >=4.8 && <4.15, phonetic-languages-simplified-generalized-examples-common >=0.1.1 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.1.1 && <1, phonetic-languages-simplified-base >=0.2 && <1, phonetic-languages-permutations-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-phonetics-basics >=0.6.2 && <1, phonetic-languages-constraints-array >=0.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, mmsyn2-array >=0.1.3 && <1, heaps >=0.3.6.1 && <1+  build-depends:       base >=4.8 && <4.15, phonetic-languages-simplified-generalized-examples-common >=0.1.2 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.2 && <1, phonetic-languages-permutations-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-phonetics-basics >=0.6.3 && <1, phonetic-languages-constraints-array >=0.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, mmsyn2-array >=0.1.3 && <1, heaps >=0.3.6.1 && <1   -- hs-source-dirs:   default-language:    Haskell2010