phonetic-languages-simplified-generalized-examples-array 0.4.2.1 → 0.5.0.0
raw patch · 8 files changed
+127/−57 lines, 8 filesdep ~phonetic-languages-simplified-generalized-properties-arrayPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: phonetic-languages-simplified-generalized-properties-array
API changes (from Hackage documentation)
- Phonetic.Languages.General.GetTextualInfo: generalProc :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> String -> String -> Bool -> [String] -> [String] -> Coeffs2 -> FilePath -> String -> Int -> Int -> String -> IO ()
+ Phonetic.Languages.General.GetTextualInfo: generalProc :: 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 :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> [String] -> IO ()
+ Phonetic.Languages.General.GetTextualInfo: getData3 :: 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: process1Line :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()
+ Phonetic.Languages.General.GetTextualInfo: process1Line :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Coeffs2 -> Int -> Int -> String -> [String] -> Array Int [Array Int Int] -> String -> IO ()
- Phonetic.Languages.General.Simple: generalProc2 :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO String
+ Phonetic.Languages.General.Simple: generalProc2 :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO String
- Phonetic.Languages.General.Simple: generalProc2G :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> [String] -> Bool -> IO ()
+ Phonetic.Languages.General.Simple: generalProc2G :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Concatenations -> String -> FilePath -> Bool -> Bool -> [String] -> Coeffs2 -> Coeffs2 -> [String] -> Bool -> IO ()
- Phonetic.Languages.General.Simple: generalProcMMs :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> IO String
+ Phonetic.Languages.General.Simple: generalProcMMs :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Bool -> Coeffs2 -> Coeffs2 -> [([Int], Int, Int, String)] -> [Array Int Int] -> [String] -> IO String
- Phonetic.Languages.General.Simple: generalProcMs :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Coeffs2 -> [Array Int Int] -> [String] -> ([Int], Int, Int, String) -> IO [Result [] Char Double Double]
+ Phonetic.Languages.General.Simple: generalProcMs :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentRulesG -> String -> String -> (Double -> String -> [[[PRS]]] -> [[Double]]) -> [[[[PRS]]] -> [[Double]]] -> Coeffs2 -> Coeffs2 -> [Array Int Int] -> [String] -> ([Int], Int, Int, String) -> IO [Result [] Char Double Double]
- 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: argsProcessment :: FilePath -> FilePath -> FilePath -> FilePath -> [String] -> IO (String, String, String, String, String, Bool, Bool, [String], Coeffs2, Coeffs2, [String], Bool)
Files
- ChangeLog.md +5/−0
- Phonetic/Languages/General/GetInfo/Parsing.hs +5/−4
- Phonetic/Languages/General/GetTextualInfo.hs +23/−16
- Phonetic/Languages/General/Simple.hs +36/−23
- Phonetic/Languages/General/Simple/Parsing.hs +13/−9
- Phonetic/Languages/Simplified/Array/General/FuncRep2RelatedG2.hs +38/−3
- README.md +5/−0
- phonetic-languages-simplified-generalized-examples-array.cabal +2/−2
ChangeLog.md view
@@ -51,3 +51,8 @@ * Fourth version revised D. Fixed issue with wrong character filtering 'ː' (that denotes the prolonged sounds in IPA) as ':' (default colon in ACSII).++## 0.5.0.0 -- 2021-07-21++* Fifth version. Added "w" and "x" lines of the properties that uses more complex rhythmicity structures and+other properties. Changed the dependencise boundaries accordingly.
Phonetic/Languages/General/GetInfo/Parsing.hs view
@@ -72,12 +72,13 @@ -> [String] -- ^ List of other command line arguments -> IO () files4ArgsProcessment !fileGWrSys !controlFile !segmentRulesFile !concatenationsFileP h qs args000 = do- let !args00 = filter (/= "++B") args000+ let !args00 = filter (\ts -> take 2 ts /= "+X" && ts /= "++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 + !coeffs = readCF . concat . take 1 $ args+ !coeffsWX = readCF . drop 2 . concat . take 1 . filter (\ts -> take 2 ts == "+X") $ args000 !lInes = filter (any (== ':')) args0 !numbersJustPrint = filter (== "@n") args0 (!wrs, !ks, !arr, !gs, !js, !vs, !ysss, !xs) = innerProcessmentSimple fileGWrSys controlFile segmentRulesFile concatenationsFileP@@ -88,7 +89,7 @@ !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+ generalProc 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 fLinesIO ysss xs js vs contents @@ -99,7 +100,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 wrs ks arr gs h qs ysss xs js vs {- the old arguments follow -} lstW multiples lInes coeffs file gzS printLine toOneLine choice+ generalProc 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 fLinesIO ysss xs js vs contents
Phonetic/Languages/General/GetTextualInfo.hs view
@@ -70,25 +70,27 @@ -> Bool -> [String] -> [String]- -> Coeffs2+ -> 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. -> FilePath -> String -> Int -> Int -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since 0.5.0.0 version can also+ -- process \"w\" and \"x\"-based lines properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> IO ()-generalProc wrs ks arr gs h rs ysss xs js vs lstW multiples2 lInes coeffs file gzS printLine toOneLine choice+generalProc wrs ks arr gs h rs ysss xs js vs lstW multiples2 lInes coeffs coeffsWX file gzS printLine toOneLine choice | null lInes = do contents <- readFile file let !flines = fLines ysss xs js vs toOneLine contents- getData3 wrs ks arr gs js vs h rs lstW coeffs (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines+ getData3 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 = fLines ysss xs js vs toOneLine . unlines . linesFromArgsG lInes . fLines ysss xs js vs 0 $ contents- getData3 wrs ks arr gs js vs h rs lstW coeffs (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines+ getData3 wrs ks arr gs js vs h rs lstW coeffs coeffsWX (getIntervalsNS lstW gzS flines) printLine choice multiples2 flines linesFromArgs1 :: Int@@ -119,17 +121,19 @@ -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most -- exact one and, therefore, the default one. -> Bool- -> Coeffs2+ -> 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. -> Int -> Int -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since 0.5.0.0 version can also+ -- process \"w\" and \"x\"-based lines properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> [String] -> [String] -> IO ()-getData3 wrs ks arr gs js vs h rs lstW coeffs gz printLine choice multiples3 zss = let !permsV4 = genPermutationsArrL in putStrLn (replicate (length multiples3 + 1) '\t' `mappend` show gz) >> mapM_ (process1Line wrs ks arr gs js vs h rs lstW coeffs gz printLine choice multiples3 permsV4) zss+getData3 wrs ks arr gs js vs h rs lstW coeffs coeffsWX gz printLine choice multiples3 zss = let !permsV4 = 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 process1Line :: GWritingSystemPRPLX -- ^ Data used to obtain the phonetic language representation of the text.@@ -147,18 +151,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. -> Bool- -> Coeffs2+ -> 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. -> Int -> Int -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since 0.5.0.0 version can also+ -- process \"w\" and \"x\"-based lines properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> [String] -> Array Int [Array Int Int] -- ^ A permutations array of indices. -> String -> IO ()-process1Line wrs ks arr gs js vs h qs lstW coeffs gz printLine choice multiples4 !permsV50 v+process1Line wrs ks arr gs js vs h qs lstW coeffs coeffsWX gz printLine choice multiples4 !permsV50 v | null multiples4 = bracket (do { myThread <- forkIO (do let !v2 = words v@@ -166,8 +172,9 @@ 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 wrs ks arr gs js vs id h coeffs qs choice )) .- uniquenessVariants2GNBL ' ' id id id permsV5 $ v2, toTransPropertiesF' (chooseMax wrs ks arr gs js vs id h coeffs qs choice) . unwords . subG (' ':js `mappend` vs) $ v))+ ((!minE,!maxE),!data2) = runEval (parTuple2 rpar rpar (minMax11C . map (toTransPropertiesF' (if take 1 choice == "w" || take 1 choice == "x" then chooseMax wrs ks arr gs js vs id h coeffsWX qs choice else chooseMax wrs ks arr gs js vs id h coeffs qs choice)) .+ uniquenessVariants2GNBL ' ' id id id permsV5 $ v2, toTransPropertiesF' (if take 1 choice == "w" || take 1 choice == "x" then chooseMax wrs ks arr gs js vs id h coeffsWX qs choice else chooseMax wrs ks arr gs js vs id h coeffs qs choice) .+ unwords . subG (' ':js `mappend` vs) $ 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"@@ -190,10 +197,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 wrs ks arr gs js vs id h coeffs qs choiceMMs)) .+ map (toTransPropertiesF' (if take 1 choiceMMs == "w" || take 1 choiceMMs == "x" then chooseMax wrs ks arr gs js vs id h coeffsWX qs choiceMMs else chooseMax wrs ks arr gs js vs id h coeffs qs choiceMMs)) . uniquenessVariants2GNBL ' ' id id id permsV5 $ v2,- toTransPropertiesF' (chooseMax wrs ks arr gs js vs id h coeffs qs choiceMMs) . unwords .- subG (' ':js `mappend` vs) $ v,gz)) multiples4+ toTransPropertiesF' (if take 1 choiceMMs == "w" || take 1 choiceMMs == "x" then chooseMax wrs ks arr gs js vs id h coeffsWX qs choiceMMs else chooseMax wrs ks arr gs js vs id h coeffs qs choiceMMs) .+ unwords . subG (' ':js `mappend` vs) $ 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/General/Simple.hs view
@@ -71,20 +71,21 @@ -> Bool -> Bool -> [String]- -> Coeffs2+ -> 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 ()-generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 interactive jstL0 args0 coeffs args lstW2+generalProc2G wrs ks arr gs js vs h qs ysss ws toFile1 interactive jstL0 args0 coeffs coeffsWX args lstW2 | variations args = do let !zsss = transformToVariations args print zsss- variantsG <- mapM (\xss -> generalProc2 wrs ks arr gs js vs h qs ysss ws interactive jstL0 args0 coeffs xss lstW2) zsss+ variantsG <- mapM (\xss -> generalProc2 wrs ks arr gs js vs h qs ysss ws interactive jstL0 args0 coeffs coeffsWX xss lstW2) zsss interactivePrintResult id variantsG >>= \rs -> case toFile1 of "" -> return () ~fileName -> appendFile fileName (rs `mappend` newLineEnding)- | otherwise = generalProc2 wrs ks arr gs js vs h qs ysss ws interactive jstL0 args0 coeffs args lstW2 >>= \rs ->+ | otherwise = generalProc2 wrs ks arr gs js vs h qs ysss ws interactive jstL0 args0 coeffs coeffsWX args lstW2 >>= \rs -> case toFile1 of "" -> return () ~fileName -> appendFile fileName (rs `mappend` newLineEnding)@@ -111,11 +112,12 @@ -> Bool -> Bool -> [String]- -> Coeffs2+ -> 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 String-generalProc2 wrs ks arr gs js vs h qs ysss ws interactive jstL0 args0 coeffs args lstW2 = do+generalProc2 wrs ks arr gs js vs h qs ysss ws 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@@ -133,13 +135,13 @@ else do let !subs = subG (' ':js `mappend` vs) xs if null argCs then let !perms = genPermutationsL l in do- temp <- generalProcMs wrs ks arr gs js vs h qs coeffs perms subs (intervalNmbrs, arg0, numberI, choice)+ temp <- generalProcMs wrs ks arr gs js vs h qs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) if interactive then interactivePrintResult line temp else print1el jstL0 choice temp 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 . genPermutationsL $ l in do- temp <- generalProcMs wrs ks arr gs js vs h qs coeffs perms subs (intervalNmbrs, arg0, numberI, choice)+ temp <- generalProcMs wrs ks arr gs js vs h qs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) if interactive then interactivePrintResult line temp else print1el jstL0 choice temp else do let !choices = map fst argMss@@ -160,12 +162,12 @@ else print1el jstL0 (concat . take 1 $ choices) wwss else do let !subs = subG (' ':js `mappend` vs) xs- if null argCs then let !perms = genPermutationsL l in generalProcMMs wrs ks arr gs js vs h qs interactive coeffs argsZipped perms subs+ if null argCs then let !perms = genPermutationsL l in generalProcMMs wrs ks arr gs js vs h qs interactive coeffs coeffsWX argsZipped perms subs 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 . genPermutationsL $ l in- generalProcMMs wrs ks arr gs js vs h qs interactive coeffs argsZipped perms subs+ generalProcMMs wrs ks arr gs js vs h qs interactive coeffs coeffsWX argsZipped perms subs -- | Function provides message information. messageInfo :: Int -> String@@ -211,22 +213,31 @@ -> [([[[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.- -> Coeffs2+ -> 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. -> [Array Int Int] -- ^ Permutations data. -> [String] -> ([Int],Int,Int,String) -- ^ The 'String' is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since 0.5.0.0 version can also+ -- process \"w\" and \"x\"-based lines properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> IO [Result [] Char Double Double]-generalProcMs wrs ks arr gs js vs h qs coeffs perms subs (intervalNmbrs, arg0, numberI, choice) = do- if compare numberI 2 == LT then let !frep2 = chooseMax wrs ks arr gs js vs id h coeffs qs choice in return . fst . maximumGroupsClassificationR arg0 .- map (toResultR frep2) . uniquenessVariants2GNBL ' ' id id id perms $ subs- else do+generalProcMs wrs ks arr gs js vs h qs coeffs coeffsWX perms subs (intervalNmbrs, arg0, numberI, choice) = do+ if compare numberI 2 == LT+ then let !frep2+ | take 1 choice == "w" || take 1 choice == "x" = chooseMax wrs ks arr gs js vs id h coeffsWX qs choice+ | otherwise = chooseMax wrs ks arr gs js vs id h coeffs qs 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 wrs ks arr gs js vs id h coeffs qs choice+ !frep20+ | take 1 choice == "w" || take 1 choice == "x" = chooseMax wrs ks arr gs js vs id h coeffsWX qs choice+ | otherwise = chooseMax wrs ks arr gs js vs id h coeffs qs choice (!minE,!maxE) = minMax11C . map (toPropertiesF' frep20) $ variants1- !frep2 = chooseMax wrs ks arr gs js vs (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) h coeffs qs choice+ !frep2+ | take 1 choice == "w" || take 1 choice == "x" = chooseMax wrs ks arr gs js vs (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) h coeffsWX qs choice+ | otherwise = chooseMax wrs ks arr gs js vs (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs) h coeffs qs choice return . fst . maximumGroupsClassificationR arg0 . map (toResultR frep2) $ variants1 -- |@@ -246,22 +257,24 @@ -- syllableDurationsD functions from the @ukrainian-phonetics-basics-array@ package. The last one must be probably the most -- exact one and, therefore, the default one. -> Bool- -> Coeffs2+ -> 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. -> [([Int],Int,Int,String)] -- ^ The 'String' is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since 0.5.0.0 version can also+ -- process \"w\" and \"x\"-based lines properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> [Array Int Int] -- ^ Permutations data. -> [String] -> IO String-generalProcMMs wrs ks arr gs js vs h qs interactiveMM coeffs rs perms subs =+generalProcMMs wrs ks arr gs js vs h qs interactiveMM coeffs coeffsWX rs perms subs = case length rs of 0 -> putStrLn (messageInfo 4) >> return "" 1 -> putStrLn (messageInfo 5) >> do- temp <- generalProcMs wrs ks arr gs js vs h qs coeffs perms subs (head rs)+ temp <- generalProcMs wrs ks arr gs js vs h qs coeffs coeffsWX perms subs (head rs) finalProc interactiveMM line temp _ -> do- genVariants <- mapM (generalProcMs wrs ks arr gs js vs h qs coeffs perms subs) rs+ genVariants <- mapM (generalProcMs wrs ks arr gs js vs h qs coeffs coeffsWX perms subs) rs finalProc interactiveMM id . foldlI . map (map line) $ genVariants foldlI :: [[String]] -> [String]
Phonetic/Languages/General/Simple/Parsing.hs view
@@ -64,10 +64,10 @@ 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+ (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 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+ if isPair coeffs then generalProc2G wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW+ else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 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,@@ -89,10 +89,10 @@ 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+ (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 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+ if isPair coeffs then generalProc2G wrs ks arr gs js vs h qs ysss ws {- old arguments follow -} toFileMode1 interactiveP jstL0 args0 coeffs coeffsWX (drop 1 args) lstW+ else generalProc2G wrs ks arr gs js vs h qs ysss ws toFileMode1 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);@@ -112,15 +112,18 @@ ws = sort . concat $ wss in (wrs, ks, arr, gs, js, vs, ysss, ws) +{-| @ since 0.5.0.0+The function also can process \"w\" and \"x\" lines so returns two 'Coeffs2' values.+-} 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)+ -> IO (String, String, String, String, String, Bool, Bool, [String], Coeffs2, 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+ 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 (/= "+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.@@ -131,5 +134,6 @@ | 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+ coeffsWX = readCF . drop 2 . concat . take 1 . filter (\ts -> take 2 ts == "+X") $ args00 [controlConts, gwrsCnts, segmentData, concatenationsFile] <- mapM readFile [controlFile, fileGWrSys, segmentRulesFile, concatenationsFileP]- return (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, args, lstW)+ return (gwrsCnts, controlConts, segmentData, concatenationsFile, toFileMode1, interactiveP, jstL0, args0, coeffs, coeffsWX, args, lstW)
Phonetic/Languages/Simplified/Array/General/FuncRep2RelatedG2.hs view
@@ -39,7 +39,8 @@ -- exact one and, therefore, the default one. -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since the 0.5.0.0 version+ -- you can use also \"w\" and \"x\"-based lines of properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> FuncRep2 String Double c chooseMax = chooseMaxG 1.3@@ -65,7 +66,8 @@ -- exact one and, therefore, the default one. -> String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since the 0.5.0.0 version+ -- you can use also \"w\" and \"x\"-based lines of properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> FuncRep2 String Double c chooseMaxG k wrs ks arr gs us vs g h coeffs xs choice = getBFstL' (procB2InvF wrs ks arr gs us vs g (xs !! 3) coeffs)@@ -77,6 +79,38 @@ ("04z",procRhythmicity23F k g h "04z" coeffs wrs ks arr gs us vs), ("0y",procRhythmicity23F k g h "0y" coeffs wrs ks arr gs us vs), ("0z",procRhythmicity23F k g h "0z" coeffs wrs ks arr gs us vs),+ ("w01",procRhythmicity23F k g h "w01" coeffs wrs ks arr gs us vs),+ ("w02",procRhythmicity23F k g h "w02" coeffs wrs ks arr gs us vs),+ ("w03",procRhythmicity23F k g h "w03" coeffs wrs ks arr gs us vs),+ ("w04",procRhythmicity23F k g h "w04" coeffs wrs ks arr gs us vs),+ ("w11",procRhythmicity23F k g h "w11" coeffs wrs ks arr gs us vs),+ ("w12",procRhythmicity23F k g h "w12" coeffs wrs ks arr gs us vs),+ ("w13",procRhythmicity23F k g h "w13" coeffs wrs ks arr gs us vs),+ ("w14",procRhythmicity23F k g h "w14" coeffs wrs ks arr gs us vs),+ ("w21",procRhythmicity23F k g h "w21" coeffs wrs ks arr gs us vs),+ ("w22",procRhythmicity23F k g h "w22" coeffs wrs ks arr gs us vs),+ ("w23",procRhythmicity23F k g h "w23" coeffs wrs ks arr gs us vs),+ ("w24",procRhythmicity23F k g h "w24" coeffs wrs ks arr gs us vs),+ ("w31",procRhythmicity23F k g h "w31" coeffs wrs ks arr gs us vs),+ ("w32",procRhythmicity23F k g h "w32" coeffs wrs ks arr gs us vs),+ ("w33",procRhythmicity23F k g h "w33" coeffs wrs ks arr gs us vs),+ ("w34",procRhythmicity23F k g h "w34" coeffs wrs ks arr gs us vs),+ ("x01",procRhythmicity23F k g h "x01" coeffs wrs ks arr gs us vs),+ ("x02",procRhythmicity23F k g h "x02" coeffs wrs ks arr gs us vs),+ ("x03",procRhythmicity23F k g h "x03" coeffs wrs ks arr gs us vs),+ ("x04",procRhythmicity23F k g h "x04" coeffs wrs ks arr gs us vs),+ ("x11",procRhythmicity23F k g h "x11" coeffs wrs ks arr gs us vs),+ ("x12",procRhythmicity23F k g h "x12" coeffs wrs ks arr gs us vs),+ ("x13",procRhythmicity23F k g h "x13" coeffs wrs ks arr gs us vs),+ ("x14",procRhythmicity23F k g h "x14" coeffs wrs ks arr gs us vs),+ ("x21",procRhythmicity23F k g h "x21" coeffs wrs ks arr gs us vs),+ ("x22",procRhythmicity23F k g h "x22" coeffs wrs ks arr gs us vs),+ ("x23",procRhythmicity23F k g h "x23" coeffs wrs ks arr gs us vs),+ ("x24",procRhythmicity23F k g h "x24" coeffs wrs ks arr gs us vs),+ ("x31",procRhythmicity23F k g h "x31" coeffs wrs ks arr gs us vs),+ ("x32",procRhythmicity23F k g h "x32" coeffs wrs ks arr gs us vs),+ ("x33",procRhythmicity23F k g h "x33" coeffs wrs ks arr gs us vs),+ ("x34",procRhythmicity23F k g h "x34" coeffs wrs ks arr gs us vs), ("y",procB2F wrs ks arr gs us vs g (xs !! 0) coeffs), ("y0",procDiverse2F wrs (' ':us `mappend` vs) g), ("y2",procB2F wrs ks arr gs us vs g (xs !! 1) coeffs),@@ -98,7 +132,8 @@ precChoice :: String -- ^ Is intended to be one of the following strings: \"02y\", \"02z\", \"03y\", \"03z\", \"04y\", \"04z\", -- \"0y\", \"0z\", \"y\", \"y0\", \"y2\", \"y3\", \"y4\", \"yy\", \"yy2\", \"yy3\", \"z\", \"z2\", \"z3\", \"z4\",- -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Specifies the applied properties+ -- \"zz\", \"zz2\", \"zz3\", \"zz4\" or some other one (that is the default one). Since the 0.5.0.0 version+ -- you can use also \"w\" and \"x\"-based lines of properties. Specifies the applied properties -- to get the result. The \"z\"-line uses \'F\' functions. -> Maybe Int precChoice = getBFstL' (Just 4) [("02y",Just 0),("02z",Just 0),("03y",Just 0),("03z",Just 0),("04y",Just 0),
README.md view
@@ -69,3 +69,8 @@ ====================================== You can use the EspeakNG_IPA module for this since the 0.4.0.0 version.++ "w" and "x" Series of properties+ ================================++Since the
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.4.2.1+version: 0.5.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.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.7 && <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+ 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.3 && <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.7 && <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 -- hs-source-dirs: default-language: Haskell2010