phonetic-languages-simplified-examples-array 0.4.2.0 → 0.5.0.0
raw patch · 10 files changed
+117/−69 lines, 10 filesdep ~phonetic-languages-rhythmicitydep ~phonetic-languages-simplified-properties-arrayPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: phonetic-languages-rhythmicity, phonetic-languages-simplified-properties-array
API changes (from Hackage documentation)
- Phonetic.Languages.GetTextualInfo: generalProc :: Bool -> [String] -> [String] -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()
+ Phonetic.Languages.GetTextualInfo: generalProc :: Bool -> [String] -> [String] -> Coeffs2 -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()
- Phonetic.Languages.GetTextualInfo: getData3 :: Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()
+ Phonetic.Languages.GetTextualInfo: getData3 :: Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()
- Phonetic.Languages.GetTextualInfo: process1Line :: Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()
+ Phonetic.Languages.GetTextualInfo: process1Line :: Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()
- Phonetic.Languages.Simple: generalProc2 :: Bool -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO String
+ Phonetic.Languages.Simple: generalProc2 :: Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO String
- Phonetic.Languages.Simple: generalProc2G :: Bool -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO ()
+ Phonetic.Languages.Simple: generalProc2G :: Bool -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
- Phonetic.Languages.Simple: generalProcMMs :: Bool -> Bool -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> IO String
+ Phonetic.Languages.Simple: generalProcMMs :: Bool -> Bool -> Coeffs2 -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> IO String
- Phonetic.Languages.Simple: generalProcMs :: Coeffs2 -> [Array Int Int] -> [String] -> ([Int], Int, Int, String) -> IO [Result [] Char Double Double]
+ Phonetic.Languages.Simple: generalProcMs :: Coeffs2 -> Coeffs2 -> [Array Int Int] -> [String] -> ([Int], Int, Int, String) -> IO [Result [] Char Double Double]
Files
- CHANGELOG.md +4/−0
- GetInfo/Main.hs +7/−5
- Lines/Main.hs +1/−1
- Phonetic/Languages/GetTextualInfo.hs +20/−13
- Phonetic/Languages/Lines.hs +7/−1
- Phonetic/Languages/Simple.hs +34/−26
- Phonetic/Languages/Simplified/Array/Ukrainian/FuncRep2RelatedG2.hs +24/−7
- README.md +10/−7
- Simple/Main.hs +5/−4
- phonetic-languages-simplified-examples-array.cabal +5/−5
CHANGELOG.md view
@@ -52,3 +52,7 @@ * Fourth version revised C. Added an English brief instructions to the package. +## 0.5.0.0 -- 2021-07-20++* Fifth version. Added two new lines ("w" and "x" lines) as a new properties evaluation strategies. Updated the dependencies+boundaries accordingly.
GetInfo/Main.hs view
@@ -1,6 +1,6 @@ -- | -- Module : Main--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com@@ -29,8 +29,10 @@ main :: IO () main = do- args000 <- getArgs- let !args00 = filter (/= "++B") args000+ args0000 <- getArgs+ let !args000 = filter (\ts -> take 2 ts /= "+X") args0000+ !coeffsWX = readCF . drop 2 . concat . take 1 . filter (\xs -> take 2 xs == "+X") $ args0000 -- The command line argument that starts with \"+X\".+ !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@@ -45,7 +47,7 @@ !printLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 3 $ args)::(Maybe Int)) -- The fourth command line argument except those ones that are RTS arguments. Set to 1 if you would like to print the current line within the information !toOneLine = fromMaybe 0 (readMaybe (concat . take 1 . drop 4 $ args)::(Maybe Int)) -- The fifth command line argument except those ones that are RTS arguments. Set to 1 if you would like to convert the text into one single line before applying to it the processment (it can be more conceptually consistent in such a case) !choice = concat . drop 5 . take 6 $ args -- The sixth command line argument that controls what properties are used.- generalProc lstW multiples lInes coeffs file gzS printLine toOneLine choice+ generalProc lstW multiples lInes coeffs coeffsWX file gzS printLine toOneLine choice else do contents <- readFile file fLinesIO contents@@ -56,7 +58,7 @@ !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 lstW multiples lInes coeffs file gzS printLine toOneLine choice+ generalProc lstW multiples lInes coeffs coeffsWX file gzS printLine toOneLine choice else do contents <- readFile file fLinesIO contents
Lines/Main.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Main--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com
Phonetic/Languages/GetTextualInfo.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Phonetic.Languages.GetTextualInfo--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com@@ -45,16 +45,22 @@ import Phonetic.Languages.Simplified.SimpleConstraints import Phonetic.Languages.Common -generalProc :: Bool -> [String] -> [String] -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()-generalProc lstW multiples2 lInes coeffs file gzS printLine toOneLine choice+{-| @ since 0.5.0.0 -- The meaning of the first command line argument (and 'Coeffs2' here everywhere in the module)+depends on the 'String' argument -- whether it starts with \'w\', \'x\' or otherwise. In the first case it represents+the k1 and k2 coefficients (default ones equal to 2.0 and 0.125) for the functions from the Rhythmicity.TwoFourth module.+Otherwise, it is used for the functions to specify the level of emphasizing the two-based and three-based periods+(the default values here are 1.0 both).+-}+generalProc :: Bool -> [String] -> [String] -> Coeffs2 -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()+generalProc lstW multiples2 lInes coeffs coeffsWX file gzS printLine toOneLine choice | null lInes = do contents <- readFile file let !flines = fLines toOneLine contents- getData3 lstW coeffs (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines+ getData3 lstW coeffs coeffsWX (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines | otherwise = do contents <- readFile file let !flines = fLines toOneLine . unlines . linesFromArgsG lInes . fLines 0 $ contents- getData3 lstW coeffs (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines+ getData3 lstW coeffs coeffsWX (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines linesFromArgs1 :: Int -> String -> [String] -> [String] linesFromArgs1 n xs yss =@@ -65,11 +71,11 @@ linesFromArgsG :: [String] -> [String] -> [String] linesFromArgsG xss yss = let n = length yss in concatMap (\ts -> linesFromArgs1 n ts yss) xss -getData3 :: Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()-getData3 lstW coeffs gz printLine choice multiples3 zss = let !permsV4 = genPermutationsArrL in putStrLn (replicate (length multiples3 + 1) '\t' `mappend` show gz) >> mapM_ (process1Line lstW coeffs gz printLine choice multiples3 permsV4) zss+getData3 :: Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()+getData3 lstW coeffs coeffsWX gz printLine choice multiples3 zss = let !permsV4 = genPermutationsArrL in putStrLn (replicate (length multiples3 + 1) '\t' `mappend` show gz) >> mapM_ (process1Line lstW coeffs coeffsWX gz printLine choice multiples3 permsV4) zss -process1Line :: Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()-process1Line lstW coeffs gz printLine choice multiples4 !permsV50 v+process1Line :: Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()+process1Line lstW coeffs coeffsWX gz printLine choice multiples4 !permsV50 v | null multiples4 = bracket (do { myThread <- forkIO (do let !v2 = words v@@ -77,8 +83,8 @@ if l2 >= (if lstW then 1 else 0) then do let !permsV5 = decodeConstraint1 (fromMaybe (E 1) . readMaybeECG (l2 + 1) . showB (l2 + 2) $ lstW) . unsafeAt permsV50 $ l2- ((!minE,!maxE),!data2) = runEval (parTuple2 rpar rpar (minMax11C . map (toTransPropertiesF' (chooseMax id coeffs choice )) .- uniquenessVariants2GNBL ' ' id id id permsV5 $ v2, toTransPropertiesF' (chooseMax id coeffs choice) . unwords . subG " 01-" $ v))+ ((!minE,!maxE),!data2) = runEval (parTuple2 rpar rpar (minMax11C . map (toTransPropertiesF' (if take 1 choice == "x" || take 1 choice == "w" then chooseMax id coeffsWX choice else chooseMax id coeffs choice)) .+ uniquenessVariants2GNBL ' ' id id id permsV5 $ v2, toTransPropertiesF' (if take 1 choice == "x" || take 1 choice == "w" then chooseMax id coeffsWX choice else chooseMax id coeffs choice) . unwords . subG " 01-" $ v)) (!wordsN,!intervalN) = (l2 + 2, intervalNRealFrac minE maxE gz data2) !ratio = if maxE == 0.0 then 0.0 else 2.0 * data2 / (minE + maxE) hPutStr stdout . showFFloat (precChoice choice) minE $ "\t"@@ -101,9 +107,10 @@ let !permsV5 = decodeConstraint1 (fromMaybe (E 1) . readMaybeECG (l2 + 1) . showB (l2 + 2) $ lstW) . unsafeAt permsV50 $ l2 rs = parMap rpar (\choiceMMs -> (minMax11C .- map (toTransPropertiesF' (chooseMax id coeffs choiceMMs)) .+ map (toTransPropertiesF' (if take 1 choiceMMs == "x" || take 1 choiceMMs == "w" then chooseMax id coeffsWX choiceMMs else chooseMax id coeffs choiceMMs)) . uniquenessVariants2GNBL ' ' id id id permsV5 $ v2,- toTransPropertiesF' (chooseMax id coeffs choiceMMs) . unwords . subG " 01-" $ v,gz)) multiples4+ toTransPropertiesF' (if take 1 choiceMMs == "x" || take 1 choiceMMs == "w" then chooseMax id coeffsWX choiceMMs else chooseMax id coeffs choiceMMs) .+ unwords . subG " 01-" $ v,gz)) multiples4 (!wordsN,!intervalNs) = (l2 + 2, map (\((!x,!y),!z,!t) -> intervalNRealFrac x y t z) rs) in do hPutStr stdout (show (wordsN::Int))
Phonetic/Languages/Lines.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Phonetic.Languages.Lines--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com@@ -34,6 +34,12 @@ import Data.Monoid (mappend) import Phonetic.Languages.Common +{-| @ since 0.5.0.0 -- The meaning of the first command line argument (and 'Coeffs2' here everywhere in the module)+depends on the 'String' argument -- whether it starts with \'w\', \'x\' or otherwise. In the first case it represents+the k1 and k2 coefficients (default ones equal to 2.0 and 0.125) for the functions from the Rhythmicity.TwoFourth module.+Otherwise, it is used for the functions to specify the level of emphasizing the two-based and three-based periods+(the default values here are 1.0 both).+-} generalProcessment :: Coeffs2 -> [String] -> String -> Int -> FilePath -> IO () generalProcessment coeffs numericArgs choice numberI file = do contents <- readFile file
Phonetic/Languages/Simple.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Phonetic.Languages.Simple--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com@@ -42,28 +42,35 @@ (yss,zss) = splitAt l xss forMultiplePropertiesF _ = [] --- |--- @ since 0.3.0.0--- Is used to do general processment.-generalProc2G :: Bool -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO ()-generalProc2G nativeUkrainian toFile1 interactive jstL0 args0 coeffs args lstW2+{-|+@ since 0.3.0.0+Is used to do general processment.+@ since 0.5.0.0+The meaning of the first command line argument (and 'Coeffs2' here everywhere in the module)+depends on the 'String' argument -- whether it starts with \'w\', \'x\' or otherwise. In the first case it represents+the k1 and k2 coefficients (default ones equal to 2.0 and 0.125) for the functions from the Rhythmicity.TwoFourth module.+Otherwise, it is used for the functions to specify the level of emphasizing the two-based and three-based periods+(the default values here are 1.0 both).+-}+generalProc2G :: Bool -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()+generalProc2G nativeUkrainian toFile1 interactive jstL0 args0 coeffs coeffsWX args lstW2 | variations args = do let !zsss = transformToVariations args print zsss- variantsG <- mapM (\xss -> generalProc2 nativeUkrainian interactive jstL0 args0 coeffs xss lstW2) zsss+ variantsG <- mapM (\xss -> generalProc2 nativeUkrainian interactive jstL0 args0 coeffs coeffsWX xss lstW2) zsss interactivePrintResult nativeUkrainian id variantsG >>= \rs -> case toFile1 of "" -> return () ~fileName -> appendFile fileName (rs `mappend` newLineEnding)- | otherwise = generalProc2 nativeUkrainian interactive jstL0 args0 coeffs args lstW2 >>= \rs ->+ | otherwise = generalProc2 nativeUkrainian interactive jstL0 args0 coeffs coeffsWX args lstW2 >>= \rs -> case toFile1 of "" -> return () ~fileName -> appendFile fileName (rs `mappend` newLineEnding) -- | -- @ since 0.3.0.0 The result is not 'IO' (), but 'IO' 'String'. The type also changed generally.-generalProc2 :: Bool -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO String-generalProc2 nativeUkrainian interactive jstL0 args0 coeffs args lstW2 = do+generalProc2 :: Bool -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO String+generalProc2 nativeUkrainian interactive jstL0 args0 coeffs coeffsWX args lstW2 = do 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@@ -75,18 +82,18 @@ !choice = concat . take 1 $ textualArgs !intervalNmbrs = (\zs -> if null zs then [numberI] else L.nub zs) . L.sort . filter (<= numberI) . map (\t -> fromMaybe numberI $ (readMaybe t::Maybe Int)) . drop 2 $ numericArgs- if compare l 2 == LT then let !frep20 = chooseMax id coeffs choice in let !wwss = (:[]) . toResultR frep20 $ xs in+ if compare l 2 == LT then let !frep20 = if take 1 choice == "x" || take 1 choice == "w" then chooseMax id coeffsWX choice else chooseMax id coeffs choice in let !wwss = (:[]) . toResultR frep20 $ xs in if interactive then interactivePrintResult nativeUkrainian line wwss else print1el jstL0 choice wwss else do let !subs = subG " 01-" xs if null argCs then let !perms = genPermutationsL l in do- temp <- generalProcMs coeffs perms subs (intervalNmbrs, arg0, numberI, choice)+ temp <- generalProcMs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) if interactive then interactivePrintResult nativeUkrainian line temp else print1el jstL0 choice temp else do correct <- printWarning nativeUkrainian xs if correct == "n" then putStrLn (messageInfo 1 nativeUkrainian) >> 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 . genPermutationsL $ l in do- temp <- generalProcMs coeffs perms subs (intervalNmbrs, arg0, numberI, choice)+ temp <- generalProcMs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) if interactive then interactivePrintResult nativeUkrainian line temp else print1el jstL0 choice temp else do let !choices = map fst argMss@@ -100,14 +107,15 @@ !xs = concat . take 1 . fLines 0 . unwords $ args !l = length . words $ xs !argCs = catMaybes (fmap (readMaybeECG (l - 1)) . (showB l lstW2:) . drop 1 . dropWhile (/= "+A") . takeWhile (/= "-A") $ args0)- if compare l 2 == LT then let !frep20 = chooseMax id coeffs (concat . take 1 $ choices) in let !wwss = (:[]) . toResultR frep20 $ xs in if interactive then interactivePrintResult nativeUkrainian line wwss else print1el jstL0 (concat . take 1 $ choices) wwss+ if compare l 2 == LT then let !frep20 = chooseMax id coeffs (concat . take 1 $ choices)+ in let !wwss = (:[]) . toResultR frep20 $ xs in if interactive then interactivePrintResult nativeUkrainian line wwss else print1el jstL0 (concat . take 1 $ choices) wwss else do let !subs = subG " 01-" xs- if null argCs then let !perms = genPermutationsL l in generalProcMMs nativeUkrainian interactive coeffs argsZipped perms subs+ if null argCs then let !perms = genPermutationsL l in generalProcMMs nativeUkrainian interactive coeffs coeffsWX argsZipped perms subs else do correct <- printWarning nativeUkrainian xs if correct == "n" then putStrLn (messageInfo 1 nativeUkrainian) >> 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 . genPermutationsL $ l in generalProcMMs nativeUkrainian interactive coeffs argsZipped perms subs+ else let !perms = decodeLConstraints argCs . genPermutationsL $ l in generalProcMMs nativeUkrainian interactive coeffs coeffsWX argsZipped perms subs {-| -- @ since 0.4.0.0@@ -148,28 +156,28 @@ putStrLn xs getLine -generalProcMs :: Coeffs2 -> [Array Int Int] -> [String] -> ([Int],Int,Int,String) -> IO [Result [] Char Double Double]-generalProcMs coeffs perms subs (intervalNmbrs, arg0, numberI, choice) = do- if compare numberI 2 == LT then let !frep2 = chooseMax id coeffs choice in return . fst . maximumGroupsClassificationR arg0 .- map (toResultR frep2) . uniquenessVariants2GNBL ' ' id id id perms $ subs+generalProcMs :: Coeffs2 -> Coeffs2 -> [Array Int Int] -> [String] -> ([Int],Int,Int,String) -> IO [Result [] Char Double Double]+generalProcMs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) = do+ if compare numberI 2 == LT then let !frep2 = if take 1 choice == "x" || take 1 choice == "w" then chooseMax id coeffsWX choice else chooseMax id coeffs choice+ in return . fst . maximumGroupsClassificationR arg0 . map (toResultR frep2) . uniquenessVariants2GNBL ' ' id id id perms $ subs else do let !variants1 = uniquenessVariants2GNBL ' ' id id id perms subs- !frep20 = chooseMax id coeffs choice+ !frep20 = if take 1 choice == "x" || take 1 choice == "w" then chooseMax id coeffsWX choice else chooseMax id coeffs choice (!minE,!maxE) = minMax11C . map (toPropertiesF' frep20) $ variants1- !frep2 = chooseMax (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) coeffs choice+ !frep2 = if take 1 choice == "x" || take 1 choice == "w" then chooseMax (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) coeffsWX choice else chooseMax (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) coeffs choice return . fst . maximumGroupsClassificationR arg0 . map (toResultR frep2) $ variants1 -- | -- @ since 0.3.0.0 The result is not 'IO' (), but 'IO' 'String'. The type also changed generally.-generalProcMMs :: Bool -> Bool -> Coeffs2 -> [([Int],Int,Int,String)] -> [Array Int Int] -> [String] -> IO String-generalProcMMs nativeUkrainian interactiveMM coeffs rs perms subs =+generalProcMMs :: Bool -> Bool -> Coeffs2 -> Coeffs2 -> [([Int],Int,Int,String)] -> [Array Int Int] -> [String] -> IO String+generalProcMMs nativeUkrainian interactiveMM coeffs coeffsWX rs perms subs = case length rs of 0 -> putStrLn (messageInfo 4 nativeUkrainian) >> return "" 1 -> putStrLn (messageInfo 5 nativeUkrainian) >> do- temp <- generalProcMs coeffs perms subs (head rs)+ temp <- generalProcMs coeffs coeffsWX perms subs (head rs) finalProc nativeUkrainian interactiveMM line temp _ -> do- genVariants <- mapM (generalProcMs coeffs perms subs) rs+ genVariants <- mapM (generalProcMs coeffs coeffsWX perms subs) rs finalProc nativeUkrainian interactiveMM id . foldlI . map (map line) $ genVariants foldlI :: [[String]] -> [String]
Phonetic/Languages/Simplified/Array/Ukrainian/FuncRep2RelatedG2.hs view
@@ -1,6 +1,6 @@ -- | -- Module : Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2--- Copyright : (c) OleksandrZhabenko 2020+-- Copyright : (c) OleksandrZhabenko 2020-2021 -- License : MIT -- Stability : Experimental -- Maintainer : olexandr543@yahoo.com@@ -22,12 +22,29 @@ ("02z",procRhythmicity23F 1.3 g "02z" coeffs), ("03y",procRhythmicity23F 1.3 g "03y" coeffs), ("03z",procRhythmicity23F 1.3 g "03z" coeffs), ("04y",procRhythmicity23F 1.3 g "04y" coeffs), ("04z",procRhythmicity23F 1.3 g "04z" coeffs), ("0y",procRhythmicity23F 1.3 g "0y" coeffs),- ("0z",procRhythmicity23F 1.3 g "0z" coeffs), ("y",procBothF g coeffs),("y0",procDiverse2F g),- ("y2",procBoth2F g coeffs),("y3",procBoth3F g coeffs), ("y4",procBoth4F g coeffs), ("yy",procBothInvF g coeffs),- ("yy2",procBoth2InvF g coeffs),("yy3",procBoth3InvF g coeffs), ("z",procBothFF 1.3 g coeffs),- ("z2",procBoth2FF 1.3 g coeffs), ("z3",procBoth3FF 1.3 g coeffs), ("z4",procBoth4FF 1.3 g coeffs),- ("zz",procBothInvFF 1.3 g coeffs), ("zz2",procBoth2InvFF 1.3 g coeffs),("zz3",procBoth3InvFF 1.3 g coeffs),- ("zz4", procBoth4InvFF 1.3 g coeffs)] choice+ ("0z",procRhythmicity23F 1.3 g "0z" coeffs), ("w01",procRhythmicity23F 1.3 g "w01" coeffs),+ ("w02",procRhythmicity23F 1.3 g "w02" coeffs), ("w03",procRhythmicity23F 1.3 g "w03" coeffs),+ ("w04",procRhythmicity23F 1.3 g "w04" coeffs), ("w11",procRhythmicity23F 1.3 g "w11" coeffs),+ ("w12",procRhythmicity23F 1.3 g "w12" coeffs), ("w13",procRhythmicity23F 1.3 g "w13" coeffs),+ ("w14",procRhythmicity23F 1.3 g "w14" coeffs), ("w21",procRhythmicity23F 1.3 g "w21" coeffs),+ ("w22",procRhythmicity23F 1.3 g "w22" coeffs), ("w23",procRhythmicity23F 1.3 g "w23" coeffs),+ ("w24",procRhythmicity23F 1.3 g "w24" coeffs), ("w31",procRhythmicity23F 1.3 g "w31" coeffs),+ ("w32",procRhythmicity23F 1.3 g "w32" coeffs), ("w33",procRhythmicity23F 1.3 g "w33" coeffs),+ ("w34",procRhythmicity23F 1.3 g "w34" coeffs), ("x01",procRhythmicity23F 1.3 g "x01" coeffs),+ ("x02",procRhythmicity23F 1.3 g "x02" coeffs), ("x03",procRhythmicity23F 1.3 g "x03" coeffs),+ ("x04",procRhythmicity23F 1.3 g "x04" coeffs), ("x11",procRhythmicity23F 1.3 g "x11" coeffs),+ ("x12",procRhythmicity23F 1.3 g "x12" coeffs), ("x13",procRhythmicity23F 1.3 g "x13" coeffs),+ ("x14",procRhythmicity23F 1.3 g "x14" coeffs), ("x21",procRhythmicity23F 1.3 g "x21" coeffs),+ ("x22",procRhythmicity23F 1.3 g "x22" coeffs), ("x23",procRhythmicity23F 1.3 g "x23" coeffs),+ ("x24",procRhythmicity23F 1.3 g "x24" coeffs), ("x31",procRhythmicity23F 1.3 g "x31" coeffs),+ ("x32",procRhythmicity23F 1.3 g "x32" coeffs), ("x33",procRhythmicity23F 1.3 g "x33" coeffs),+ ("x34",procRhythmicity23F 1.3 g "x34" coeffs), ("y",procBothF g coeffs),("y0",procDiverse2F g),+ ("y2",procBoth2F g coeffs),("y3",procBoth3F g coeffs), ("y4",procBoth4F g coeffs),+ ("yy",procBothInvF g coeffs),("yy2",procBoth2InvF g coeffs),("yy3",procBoth3InvF g coeffs),+ ("z",procBothFF 1.3 g coeffs),("z2",procBoth2FF 1.3 g coeffs),+ ("z3",procBoth3FF 1.3 g coeffs), ("z4",procBoth4FF 1.3 g coeffs),+ ("zz",procBothInvFF 1.3 g coeffs),("zz2",procBoth2InvFF 1.3 g coeffs),+ ("zz3",procBoth3InvFF 1.3 g coeffs),("zz4", procBoth4InvFF 1.3 g coeffs)] choice -- | Allows to choose precision in the Numeric.showFDouble function being given a choice parameter. precChoice :: String -> Maybe Int
README.md view
@@ -1,11 +1,11 @@ The short (possibly) instruction how to use the programs of the package phonetic-languages-simplified-examples-array in Ukrainian is here: -https://web.archive.org/web/20210419065703/https://oleksandrzhabenko.github.io/uk/Instruction_phonetic-languages-simplified-examples-array-0.4.0.1.pdf+https://oleksandrzhabenko.github.io/uk/Instruction_phonetic-languages-simplified-examples-array-0.5.0.0.pdf The instruction in English is here: -https://web.archive.org/web/20210531214157/https://oleksandrzhabenko.github.io/uk/Eng-Ukrainian_as_a_Phonetic_Language_Instructions.pdf+https://web.archive.org/web/20210720181838/https://oleksandrzhabenko.github.io/uk/Eng-Ukrainian_as_a_Phonetic_Language_Instructions-0.5.0.0.pdf Since the version 0.2.0.0 there exist also comparative mode for the rewritePoemG3 executable. It allows to create from two files with the text variants the new one. For more information in Ukrainian, please, refer to the instruction above to the@@ -18,16 +18,19 @@ informational messages during the work of the lineVariantsG3 executable (using the "+U" command line option not inside the groups of options). +Since the version 0.5.0.0 added two new lines with more complex behaviours ("w" and "x" lines). For more information,+please, refer to the section 'WX argument' in the instructions above.+ * Examples of usage 1) lineVariantsG3: -lineVariantsG3 <first argument> [<whether print the values of the property(ies)> <whether the last word must remain+lineVariantsG3 <first argument> [<WX argument> <whether print the values of the property(ies)> <whether the last word must remain on its place>] <numeric arguments> <property type> <Ukrainian text> or: -lineVariantsG3 <first argument> [<whether print the values of the property(ies)> <whether the last word must remain+lineVariantsG3 <first argument> [<WX argument> <whether print the values of the property(ies)> <whether the last word must remain on its place>] <numeric arguments> <property type> <Ukrainian text> <somewhere among the arguments as a single group: constraints> More partucular example of the abovementioned one:@@ -63,13 +66,13 @@ 2) propertiesTextG3: -propertiesTextG3 <first argument> <file with Ukrainian text> <control of the quantity of the intervals>+propertiesTextG3 <first argument> [<WX argument>] <file with Ukrainian text> <control of the quantity of the intervals> <control of printing the line of the text, too> <control of the sectioning into the lines> <property type> -propertiesTextG3 <first argument> <file with Ukrainian text> <control of the quantity of the intervals>+propertiesTextG3 <first argument> [<WX argument>] <file with Ukrainian text> <control of the quantity of the intervals> <control of printing the line of the text, too> <control of the sectioning into the lines> <property type> | distributionTextG <the same argument of the quantity of the lines> <whether to output also by-line statistics> -PowerShell -Command "propertiesTextG3 <first argument> <file with Ukrainian text> <control of the quantity+PowerShell -Command "propertiesTextG3 <first argument> [<WX argument>] <file with Ukrainian text> <control of the quantity of the intervals> <control of printing the line of the text, too> <control of the sectioning into the lines> <property type> | distributionTextG <the same argument of the quantity of the lines> <whether to output also by-line statistics>”
Simple/Main.hs view
@@ -31,7 +31,7 @@ main :: IO () main = do args00 <- getArgs- let args0 = filter (\xs -> xs /= "++B" && xs /= "++L" && xs /= "++BL" && xs /= "++I" && xs /= "+U") args00+ 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. nativeUkrainian = if any (== "+U") args00 then True else False -- If one of the command line options is \"+U\" then the informational messages are printed in Ukrainian, otherwise (the default behaviour) they are in English.@@ -42,6 +42,7 @@ | 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 -- The first command line argument. - if isPair coeffs then generalProc2G nativeUkrainian toFileMode1 interactiveP jstL0 args0 coeffs (drop 1 args) lstW- else generalProc2G nativeUkrainian toFileMode1 interactiveP jstL0 args0 coeffs args lstW+ coeffs = readCF . concat . take 1 $ args -- The first command line argument.+ coeffsWX = readCF . drop 2 . concat . take 1 . filter (\xs -> take 2 xs == "+X") $ args00 -- The command line argument that starts with \"+X\".+ if isPair coeffs then generalProc2G nativeUkrainian toFileMode1 interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW+ else generalProc2G nativeUkrainian toFileMode1 interactiveP jstL0 args0 coeffs coeffsWX args lstW
phonetic-languages-simplified-examples-array.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-examples-array-version: 0.4.2.0+version: 0.5.0.0 synopsis: Helps to create Ukrainian texts with the given phonetic properties. description: Uses more functionality of the arrays and lists. The vector-related functionality is removed and this made the executables and libraries much more lightweight. Deal the Ukrainian as one of the phonetic languages. For the short introduction in English, please, refer to: https://functional-art.org/2020/papers/Poetry-OleksandrZhabenko.pdf. Since the version 0.3.0.0 the package has the multiple variations mode for @lineVariantsG3@ executable that allows to use modifications in the text, e. g. synonyms, paraphrases etc. homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array@@ -20,7 +20,7 @@ exposed-modules: Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2, Phonetic.Languages.Simple, Phonetic.Languages.Lines, Phonetic.Languages.GetTextualInfo, Phonetic.Languages.Parsing -- other-modules: other-extensions: BangPatterns- build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.2 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.2 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1+ build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.3 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.3.2 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1 -- hs-source-dirs: default-language: Haskell2010 @@ -28,7 +28,7 @@ main-is: Main.hs other-modules: Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2, Phonetic.Languages.Simple, Phonetic.Languages.Parsing other-extensions: BangPatterns- build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.2 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-plus >=0.2 && <1, subG >=0.4 && < 1, mmsyn2-array >= 0.1.3 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1+ build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.3 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-plus >=0.2 && <1, subG >=0.4 && < 1, mmsyn2-array >= 0.1.3 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1 ghc-options: -threaded -rtsopts hs-source-dirs: ., Simple default-language: Haskell2010@@ -37,7 +37,7 @@ main-is: Main.hs other-modules: Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2, Phonetic.Languages.Lines, Phonetic.Languages.Parsing other-extensions: BangPatterns- build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.2 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.2 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1+ build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.3 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.3.2 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1 ghc-options: -threaded -rtsopts hs-source-dirs: ., Lines default-language: Haskell2010@@ -46,7 +46,7 @@ main-is: Main.hs other-modules: Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2, Phonetic.Languages.GetTextualInfo, Phonetic.Languages.Parsing other-extensions: BangPatterns- build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.2 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.2 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1+ build-depends: base >=4.8 && <4.15, ukrainian-phonetics-basic-array >=0.1.2 && <1, phonetic-languages-simplified-base >=0.1 && <1, phonetic-languages-simplified-properties-array >=0.3 && <1, phonetic-languages-ukrainian-array >=0.1 && <1, phonetic-languages-filters-array >=0.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4, phonetic-languages-plus >=0.2 && <1, subG >= 0.4 && < 1, phonetic-languages-rhythmicity >=0.3.2 && <1, phonetic-languages-permutations-array >= 0.1 && <1, heaps >= 0.3.6.1 && <1, phonetic-languages-constraints-array >=0.1 && <1, phonetic-languages-simplified-examples-common >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1 ghc-options: -threaded -rtsopts hs-source-dirs: ., GetInfo default-language: Haskell2010