packages feed

phonetic-languages-simplified-generalized-examples-array 0.10.1.0 → 0.11.0.0

raw patch · 5 files changed

+94/−13 lines, 5 filesdep ~basedep ~phonetic-languages-phonetics-basicsdep ~phonetic-languages-plus

Dependency ranges changed: base, phonetic-languages-phonetics-basics, phonetic-languages-plus, phonetic-languages-simplified-generalized-examples-common, string-interpreter

Files

ChangeLog.md view
@@ -114,3 +114,11 @@  * The tenth version revised. Fixed issues with the custom user defined polyrhythmicity patterns. Changed the documentation instructions in editor. Updated the dependency boundaries accordingly.++## 0.11.0.0 -- 2021-09-04++* The eleventh version. Added new mode of multiple sources processment (+t_ ... -t). Added the possibility to+count in the recursive mode not just from the beginning of the word concatenation but also from the end using+the commonly used programming pattern of the negative integer indexing. Updated the dependencies so that now+it can use multiple improvements of the dependencies. Some documentation improvements.+
Phonetic/Languages/General/Simple.hs view
@@ -38,7 +38,7 @@ import Phonetic.Languages.General.SimpleConstraints import Phonetic.Languages.General.Common import Data.Phonetic.Languages.Syllables-import Interpreter.StringConversion (convStringInterpreter)+import Interpreter.StringConversion   forMultiplePropertiesF :: [String] -> [(String,[String])]@@ -49,6 +49,65 @@            (yss,zss) = splitAt l xss forMultiplePropertiesF _ = [] +{-| Is used to organize the most complex processment -- for multiple sources and probably recursively.+-}+generalProc3G+ :: (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.+ -> Int+ -> 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.+ -> CharPhoneticClassification -- ^ The 'Array' 'Int' 'PRS' must be sorted in the ascending order to be used in the module correctly.+ -> SegmentRulesG+ -> String+ -> String+ -> (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.+ -> Concatenations -- ^ Data used to concatenate the basic grammar preserving words and word sequences to the next word to+ -- leave the most of the meaning (semantics) of the text available to easy understanding while reading and listening to.+ -> String+ -> FilePath+ -> Bool -- ^ Whether to run in the recursive mode.+ -> Bool+ -> Bool+ -> [String]+ -> Coeffs2 -- ^ This value is used when property choice is NOT from the \"w\" or \"x\" lines.+ -> Coeffs2 -- ^ This value is used when property choice is from the \"w\" or \"x\" lines.+ -> [String]+ -> Bool+ -> IO ()+generalProc3G p textProcessmentFss textProcessment0 textProcessment1 wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0 args0 coeffs coeffsWX args lstW2+ | null textProcessment0 = generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0 args0 coeffs coeffsWX args lstW2+ | null textProcessmentFss = mapM_ (\_ -> do  -- interactive training mode+    putStrLn . messageInfo $ 7+    lineA <- getLine+    generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0+      (fullArgsConvertTextualSimple p lineA args0) coeffs coeffsWX (fullArgsConvertTextualSimple p lineA args)+      lstW2) [0..]+ | textProcessment1 `elem` [21,31,41,51,61,71] =+    mapM_ (mapM_ (\tss -> generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0+                 (fullArgsConvertTextualSimple p tss args0) coeffs coeffsWX+                 (fullArgsConvertTextualSimple p tss args) lstW2) .+                  prepareTuneTextMN m 1 ysss ws . unwords . lines) textProcessmentFss+ | textProcessment1 `elem` [20,30,40,50,60,70] =+    mapM_ (mapM_ (\tss -> generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0+                  (fullArgsConvertTextualSimple p tss args0) coeffs coeffsWX+                  (fullArgsConvertTextualSimple p tss args) lstW2) . lines) textProcessmentFss+ | otherwise =+    mapM_ (mapM_ (\tss -> generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 recursiveMode interactive jstL0+                  (fullArgsConvertTextualSimple p tss args0) coeffs coeffsWX+                  (fullArgsConvertTextualSimple p tss args) lstW2) .+                  prepareTuneTextMN 7 1 ysss ws . unwords . lines) textProcessmentFss+        where m = quot textProcessment1 10++ -- | Is used to do general processment. generalProc2G  :: GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.@@ -187,6 +246,7 @@  | n == 4 = "No data has been specified to control the computation process. "  | n == 5 = "(/ You have specified properties / property and the range(s) so that for the words and their concatenations there are no variants available. Try to change the call parameters /)"  | n == 6 = "If you would like to run the program (call the function) recursively with changes for the words or letter connections then, please, enter here the encoded string of the interpreter. If you would NOT like to use it recursively, then just press Enter."+ | n == 7 = "Please, input the text line for analysis. "  | otherwise = "You have specified just one variant of the properties. "  -- |
Phonetic/Languages/General/Simple/Parsing.hs view
@@ -25,6 +25,7 @@ import Text.Read (readMaybe) import Data.Maybe (fromMaybe) import Data.Phonetic.Languages.SpecificationsRead+import Interpreter.StringConversion (readFileIfAny)  -- | Prints the rearrangements with the \"property\" information for the phonetic language text. -- Most of the arguments are obtained from the 'getArgs' function.@@ -59,17 +60,24 @@  -> [([[[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 -> Bool) -- ^ The predicate that checks whether the given argument is not a phonetic language word in the representation.  -> IO ()-argsToSimplePrepare h qs = do- args0000 <- getArgs- let args000 = filter (/= "+r") args0000+argsToSimplePrepare h qs p = do+ args00000 <- getArgs+ let 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+     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      (!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  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 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW- else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX args lstW+ textProcessmentFss0 <- mapM (readFileIfAny) textProcessmentFssFs+ let textProcessmentFss = filter (not . null) textProcessmentFss0+ if isPair coeffs then generalProc3G 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+ else generalProc3G p textProcessmentFss textProcessment0 textProcessment1 wrs ks arr gs js vs h qs ysss ws toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX 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,@@ -87,16 +95,20 @@   -- 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'.+ -> (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.+ -> Int  -> IO ()-argsToSimplePrepare4Files fileGWrSys controlFile segmentRulesFile concatenationsFileP h qs other_args = do+argsToSimplePrepare4Files 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  (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 generalProc2G wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW- else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX args lstW+ if isPair coeffs then generalProc3G 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+ else generalProc3G p textProcessmentFss textProcessment0 textProcessment1 wrs ks arr gs js vs h qs ysss ws toFileMode1 recursiveMode interactiveP jstL0 args0 coeffs coeffsWX 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);
README.md view
@@ -76,11 +76,12 @@ 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:-https://oleksandrzhabenko.github.io/uk/InstructionEng.pdf+https://oleksandrzhabenko.github.io/uk/InstructionEng.11.pdf  or here: -https://web.archive.org/web/20210824202435/https://oleksandrzhabenko.github.io/uk/InstructionEng.pdf+https://web.archive.org/web/20210904195153/https://oleksandrzhabenko.github.io/uk/InstructionEng.11.pdf+  There are also some additional information there about the changes in the 0.6.0.0 version. 
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.10.1.0+version:             0.11.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.15, phonetic-languages-simplified-generalized-examples-common >=0.2 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.8.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.8.1 && <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, mmsyn3 >=0.1.5 && <1, process >= 1.6.2 && <2, string-interpreter >=0.2 && <1+  build-depends:       base >=4.8 && <4.16, phonetic-languages-simplified-generalized-examples-common >=0.2.1 && <1, subG >=0.4.2 && <1, phonetic-languages-simplified-generalized-properties-array >=0.8.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.8.4 && <1, phonetic-languages-constraints-array >=0.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.4 && <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.2 && <1   -- hs-source-dirs:   default-language:    Haskell2010