packages feed

phonetic-languages-plus 0.2.0.0 → 0.3.0.0

raw patch · 6 files changed

+287/−69 lines, 6 filesdep +mmsyn2-arraydep +mmsyn5dep ~basedep ~bytestringnew-component:exe:unconcatUkr

Dependencies added: mmsyn2-array, mmsyn5

Dependency ranges changed: base, bytestring

Files

ChangeLog.md view
@@ -13,3 +13,9 @@ * Second version. Added the new library module  Data.Statistics.RulesIntervalsPlus. Added the possibility to process in a special way the 'almost empty' lines of the input by the distributionTextG executable that can be used by the other packages further.++## 0.3.0.0 -- 2021-08-31++* Third version. Added a new module and executable to reverse many of the Ukrainian language as the phonetic one+being made. Splitted the code for the distributionTextG executable into the library and executable parts. Some+code improvements. Added two new lightweight dependencies.
Distribution/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@@ -24,27 +24,13 @@  {-# OPTIONS_GHC -threaded -rtsopts #-} -{-# LANGUAGE CPP, BangPatterns #-}+{-# LANGUAGE CPP #-}  module Main where -#ifdef __GLASGOW_HASKELL__-#if __GLASGOW_HASKELL__>=710-/* code that applies only to GHC 7.10.* and higher versions */-import GHC.Base (mconcat)-#endif-#endif-import Control.Parallel.Strategies-import Data.Maybe (fromMaybe,mapMaybe)-import Text.Read (readMaybe)-import System.Environment-import Numeric (showFFloat)-import Data.List (sort)-import Numeric.Stats import qualified Data.ByteString.Char8 as B-import Data.Lists.FLines hiding (mconcat)-import Data.Statistics.RulesIntervals-import Data.Statistics.RulesIntervalsPlus+import System.Environment+import Distribution.Processment #ifdef __GLASGOW_HASKELL__ #if __GLASGOW_HASKELL__==708 /* code that applies only to GHC 7.8.* */@@ -56,51 +42,9 @@ main = do   args0 <- getArgs   let !args = filter (/= "+W") args0-      !gzS = concat . take 1 $ args-      !printInput = concat . drop 1 . take 2 $ args+      !gzS = mconcat . take 1 $ args+      !printInput = mconcat . drop 1 . take 2 $ args       !whitelines = any (== "+W") args0 -- Usually, if specified -- the third argument   contents <- B.getContents   innerProc whitelines gzS printInput contents--innerProc :: Bool -> String -> String -> B.ByteString -> IO ()-innerProc whitelines gzS printInput contents = do-  if printInput == "1" then B.putStr contents else B.putStr B.empty-  (!data31,!wordsCnt0_data32) <- processContents whitelines contents-  let !gz = getIntervalsN gzS data31 -- Obtained from the first command line argument except those ones that are for RTS-      !pair2s = zip data31 wordsCnt0_data32-      !data4 = mapMaybe (\(!x,(!y,_)) -> if y > 1 then Just x else Nothing) pair2s-  if null data4 then putStrLn (replicate 102 '-') >> putStrLn "1.000+-0.000\tALL!" >> putStrLn (replicate 102 '=') -- Well, this means that all the text consists of the lines that have no variativity from the program perspective and, therefore, they cannot be analyzed effectively by it. Nevertheless, you can accurately exclude them from the consideration. A rather rare occurrence.-  else do-      let (!mean1,!disp) = meanWithDispD2 data4-          !pairs = sort . filter ((/= 0) . snd) $ wordsCnt0_data32-          g !m !n = (length . takeWhile (\(_,v) -> v == n) . dropWhile (\(_,v) -> v /= n) . takeWhile (\(u,_) -> u == m) . dropWhile (\(u,_) -> u /= m) $ pairs) `using` rdeepseq-          h !y !x = mconcat [mconcat . map (\m1 -> mconcat [mconcat . map (\n1 ->  (if y then show (g m1 n1) else if g m1 n1 == 0 then "." else show (g m1 n1)) ++ "\t") $ [1..gz],newLineEnding]) $ [2..7],replicate 102 x]-      putStrLn . generalInfo1 gz pairs (mean1, disp) $ data31-      putStrLn (h False '~')-      putStrLn (h True '=')--processContents :: Bool -> B.ByteString -> IO ([Double],[(Int,Int)])-processContents whitelines contents = do-    let !anlines = B.lines contents-        !anStrs-          | whitelines = filter (not . null) . map (drop 6 . take 9 . B.words) $ anlines-          | otherwise = map (drop 6 . take 9 . B.words) anlines-        !ratioStrs = map (B.unpack . head) anStrs-        !wordsNStrs = map (B.unpack . (!! 1)) anStrs-        !intervalNStrs = map (B.unpack . last) anStrs-        !ratios = map (\xs -> fromMaybe 1.0 (readMaybe xs::Maybe Double)) ratioStrs-        !wordsNs = map (\xs -> fromMaybe 0 (readMaybe xs::Maybe Int)) wordsNStrs-        !intervalNs = map (\xs -> fromMaybe 0 (readMaybe xs::Maybe Int)) intervalNStrs-    return (ratios,zip wordsNs intervalNs)--generalInfo1 :: Int -> [(Int,Int)] -> (Double,Double) -> [Double] -> String-generalInfo1 gz pairs (mean1, disp) data31 =- let !ks = map (\r -> length . takeWhile (== r) . dropWhile (/= r) . sort . map snd $ pairs) [1..gz]-     !s = sum ks in-       mconcat [replicate 102 '-', newLineEnding, mconcat . map (\r -> show r ++ "\t") $ [1..gz], newLineEnding, mconcat . map (\r ->  show r ++ "\t") $ ks,-         newLineEnding, mconcat . map (\r -> showFFloat (Just 2) (fromIntegral (r * 100) / fromIntegral s)  "%\t") $ ks,newLineEnding,-          mconcat [showFFloat (Just 4) mean1 "+-", showFFloat (Just 4) (sqrt disp) "\t", show (length . filter ((<= 1) . fst) $ pairs),-           '\t':show (length data31)], newLineEnding, mconcat . map (\r -> show r ++ "\t") $ [2..7], newLineEnding, mconcat .-              map (\r ->  (show . length . takeWhile (== r) . dropWhile (/= r) . map fst $ pairs) ++ "\t") $ [2..7], newLineEnding, replicate 102 '*']-{-# INLINE generalInfo1 #-} 
+ Distribution/Processment.hs view
@@ -0,0 +1,96 @@+-- |+-- Module      :  Distribution.Processment+-- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+-- Analyzes a poetic text in Ukrainian, for every line prints statistic data and+-- then for the whole poem prints the hypothesis evaluation information.+-- Is used in pair with some other programs, e. g. with propertiesText from uniqueness-periods-vector-exampls package+-- or with a new phonetic-languages-ukrainian series.+-- The module contains library functions for the program.+-- The program tries to be more accurate in cases of the lines consisting entirely of the words+-- which are unique in phonetic meaning alongside the line. Another hypothesis is for the seventh command line+-- argument equal to \"y0\" that the distribution+-- of the placement of the actual poetic text in Ukrainian is not one of the standard distributions.+-- It can probably have approximately a form of and is different for different authors:+--+-- >    --   --   --+-- >   /  \_/  \_/  \+--+-- To enable parallel computations (potentially, they can speed up the work), please, run the @distributionText@ executable with+-- @+RTS -threaded -RTS@ command line options with possibly @-N@ option inside.+--++{-# OPTIONS_GHC -threaded -rtsopts #-}++{-# LANGUAGE CPP, BangPatterns #-}++module Distribution.Processment where++#ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__>=710+/* code that applies only to GHC 7.10.* and higher versions */+import GHC.Base (mconcat)+#endif+#endif+import Control.Parallel.Strategies+import Data.Maybe (fromMaybe,mapMaybe)+import Text.Read (readMaybe)+import Numeric (showFFloat)+import Data.List (sort)+import Numeric.Stats+import qualified Data.ByteString.Char8 as B+import Data.Lists.FLines hiding (mconcat)+import Data.Statistics.RulesIntervals+import Data.Statistics.RulesIntervalsPlus+#ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__==708+/* code that applies only to GHC 7.8.* */+mconcat = concat+#endif+#endif++innerProc :: Bool -> String -> String -> B.ByteString -> IO ()+innerProc whitelines gzS printInput contents = do+  if printInput == "1" then B.putStr contents else B.putStr B.empty+  (!data31,!wordsCnt0_data32) <- processContents whitelines contents+  let !gz = getIntervalsN gzS data31 -- Obtained from the first command line argument except those ones that are for RTS+      !pair2s = zip data31 wordsCnt0_data32+      !data4 = mapMaybe (\(!x,(!y,_)) -> if y > 1 then Just x else Nothing) pair2s+  if null data4 then putStrLn (replicate 102 '-') >> putStrLn "1.000+-0.000\tALL!" >> putStrLn (replicate 102 '=') -- Well, this means that all the text consists of the lines that have no variativity from the program perspective and, therefore, they cannot be analyzed effectively by it. Nevertheless, you can accurately exclude them from the consideration. A rather rare occurrence.+  else do+      let (!mean1,!disp) = meanWithDispD2 data4+          !pairs = sort . filter ((/= 0) . snd) $ wordsCnt0_data32+          g !m !n = (length . takeWhile (\(_,v) -> v == n) . dropWhile (\(_,v) -> v /= n) . takeWhile (\(u,_) -> u == m) . dropWhile (\(u,_) -> u /= m) $ pairs) `using` rdeepseq+          h !y !x = mconcat [mconcat . map (\m1 -> mconcat [mconcat . map (\n1 ->  (if y then show (g m1 n1) else if g m1 n1 == 0 then "." else show (g m1 n1)) ++ "\t") $ [1..gz],newLineEnding]) $ [2..7],replicate 102 x]+      putStrLn . generalInfo1 gz pairs (mean1, disp) $ data31+      putStrLn (h False '~')+      putStrLn (h True '=')++processContents :: Bool -> B.ByteString -> IO ([Double],[(Int,Int)])+processContents whitelines contents = do+    let !anlines = B.lines contents+        !anStrs+          | whitelines = filter (not . null) . map (drop 6 . take 9 . B.words) $ anlines+          | otherwise = map (drop 6 . take 9 . B.words) anlines+        !ratioStrs = map (B.unpack . head) anStrs+        !wordsNStrs = map (B.unpack . (!! 1)) anStrs+        !intervalNStrs = map (B.unpack . last) anStrs+        !ratios = map (\xs -> fromMaybe 1.0 (readMaybe xs::Maybe Double)) ratioStrs+        !wordsNs = map (\xs -> fromMaybe 0 (readMaybe xs::Maybe Int)) wordsNStrs+        !intervalNs = map (\xs -> fromMaybe 0 (readMaybe xs::Maybe Int)) intervalNStrs+    return (ratios,zip wordsNs intervalNs)++generalInfo1 :: Int -> [(Int,Int)] -> (Double,Double) -> [Double] -> String+generalInfo1 gz pairs (mean1, disp) data31 =+ let !ks = map (\r -> length . takeWhile (== r) . dropWhile (/= r) . sort . map snd $ pairs) [1..gz]+     !s = sum ks in+       mconcat [replicate 102 '-', newLineEnding, mconcat . map (\r -> show r ++ "\t") $ [1..gz], newLineEnding, mconcat . map (\r ->  show r ++ "\t") $ ks,+         newLineEnding, mconcat . map (\r -> showFFloat (Just 2) (fromIntegral (r * 100) / fromIntegral s)  "%\t") $ ks,newLineEnding,+          mconcat [showFFloat (Just 4) mean1 "+-", showFFloat (Just 4) (sqrt disp) "\t", show (length . filter ((<= 1) . fst) $ pairs),+           '\t':show (length data31)], newLineEnding, mconcat . map (\r -> show r ++ "\t") $ [2..7], newLineEnding, mconcat .+              map (\r ->  (show . length . takeWhile (== r) . dropWhile (/= r) . map fst $ pairs) ++ "\t") $ [2..7], newLineEnding, replicate 102 '*']+{-# INLINE generalInfo1 #-}+
+ Ukrainian/Main.hs view
@@ -0,0 +1,37 @@+-- |+-- Module      :  Main+-- Copyright   :  (c) OleksandrZhabenko 2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+--++{-# OPTIONS_GHC -threaded -rtsopts #-}++{-# LANGUAGE CPP #-}++module Main where++import Ukrainian.ReverseConcatenations+import System.Environment+#ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__==708+/* code that applies only to GHC 7.8.* */+mconcat = concat+#endif+#endif++main :: IO ()+main = do+  args0 <- getArgs+  let !args = filter (/= "-i") args0+      !stdinput = any (== "-i") args0 -- If you specify \"-i\" then reads the input text from the stdin otherwise from the file specified instead.+  if stdinput then do+     contents <- getContents+     putStrLn . reverseConcatenations $ contents+  else do+     let !file = concat . take 1 $ args+         !toFile = concat . drop 1 . take 2 $ args+     if null file then putStrLn "No file to read the Ukrainian text is specified. "+     else readFile file >>= return . reverseConcatenations >>= (\ts -> if null toFile then putStrLn ts else writeFile toFile ts)
+ Ukrainian/ReverseConcatenations.hs view
@@ -0,0 +1,126 @@+-- |+-- Module      :  Ukrainian.ReverseConcatenations+-- Copyright   :  (c) OleksandrZhabenko 2020-2021+-- License     :  MIT+-- Stability   :  Experimental+-- Maintainer  :  olexandr543@yahoo.com+--+-- Contains several functions that helps to reverse many of the phonetic languages approach concatenations+-- for the Ukrainian language.++{-# OPTIONS_GHC -threaded -rtsopts #-}++{-# LANGUAGE CPP, BangPatterns #-}++module Ukrainian.ReverseConcatenations where++#ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__>=710+/* code that applies only to GHC 7.10.* and higher versions */+import GHC.Base (mconcat)+#endif+#endif+import Data.List (sort,isPrefixOf)+import CaseBi.Arr (getBFstL')+import Data.List.InnToOut.Basic (mapI)+#ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__==708+/* code that applies only to GHC 7.8.* */+mconcat = concat+#endif+#endif++{-| Reverses many phonetic languages approach related concatenations for the Ukrainian text. Is intended to be used+with the text on several lines. -}+reverseConcatenations :: String -> String+reverseConcatenations xs+ | null xs = []+ | otherwise = unlines . map (unwords . mapI (const True) reverseConcat1 . words) . lines $ xs+     where yss = lines xs+           zsss = map words yss++{-| Reverses many phonetic languages approach related concatenations for just one Ukrainian word. Is used+internally in the 'reverseConcatenations'. -}+reverseConcat1 :: String -> [String]+reverseConcat1 xs+ | null xs = []+ | otherwise = getBFstL' [xs] [howConcat1WordEntirely "\1072\1073\1086" us,("\1072\1076\1078",+    howConcat1Word 1 us "\1077" "\1072\1076\1078\1077" xs),howConcat1WordEntirely "\1072\1083\1077" us,+    ("\1072\1085\1110", howConcat1Word 1 us "\1078" "\1072\1085\1110\1078" xs),+    ("\1073\1086\1076",howConcat1Word 2 us "\1072\1081" "\1073\1086\1076\1072\1081" xs),+    ("\1073\1091\1094",howConcat1Word 4 us "\1110\1084\1090\1086" "\1073\1091\1094\1110\1084\1090\1086" xs),+    howConcat1WordEntirely "\1074\1078\1077" us, ("\1074\1080\1082",+    howConcat1Word 5 us "\1083\1102\1095\1085\1086" "\1074\1080\1082\1083\1102\1095\1085\1086" xs),+    ("\1074\1083\1072",howConcat1Word 3 us "\1089\1085\1077" "\1074\1083\1072\1089\1085\1077" xs),+    ("\1074\1084\1110",if take 8 us == "\1088\1091\1090\1086\1075\1086\1103\1082" then "\1074":"\1084\1110\1088\1091":"\1090\1086\1075\1086":"\1103\1082":[drop 11 xs]+    else [xs]), ("\1074\1090\1110",howConcat1Word 1 us "\1084" "\1074\1090\1110\1084" xs),+    ("\1076\1072\1074",howConcat1Word 2 us "\1072\1081" "\1076\1072\1074\1072\1081" xs),+    ("\1076\1072\1088",howConcat1Word 4 us "\1084\1072\1097\1086" "\1076\1072\1088\1084\1072\1097\1086" xs),+    ("\1076\1083\1103", if take 7 us == "\1090\1086\1075\1086\1097\1086\1073" then "\1076\1083\1103":"\1090\1086\1075\1086":"\1097\1086\1073":[drop 7 xs]+    else [xs]), ("\1079\1072\1083", if take 7 us == "\1077\1078\1085\1086\1074\1110\1076" then "\1079\1072\1083\1077\1078\1085\1086":"\1074\1110\1076":[drop 7 xs]+    else [xs]), ("\1079\1072\1084", if take 11 us == "\1110\1089\1090\1100\1090\1086\1075\1086\1097\1086\1073"+    then "\1079\1072\1084\1110\1089\1090\1100":"\1090\1086\1075\1086":"\1097\1086\1073":[drop 11 xs] else [xs]),+    ("\1079\1072\1090", howConcat1Word 1 us "\1077" "\1079\1072\1090\1077" xs), ("\1079\1090\1080",+    if take 4 us == "\1084\1097\1086\1073" then "\1079":"\1090\1080\1084":"\1097\1086\1073":[drop 4 xs] else [xs]),+    ("\1079\1090\1086", if take 8 us == "\1075\1086\1095\1072\1089\1091\1103\1082" then "\1079":"\1090\1086\1075\1086":"\1095\1072\1089\1091":"\1103\1082":[drop 8 xs]+    else [xs]), ("\1082\1086\1083", howConcat1Word 1 us "\1080" "\1082\1086\1083\1080" xs),("\1083\1077\1076",+    howConcat1Word 2 us "\1074\1077" "\1083\1077\1076\1074\1077" xs), ("\1083\1080\1096", howConcat1Word 1 us "\1077" "\1083\1080\1096\1077" xs),+    ("\1084\1072\1081", howConcat1Word 2 us "\1078\1077" "\1084\1072\1081\1078\1077" xs),+    ("\1084\1086\1074", if take 4 us == "\1073\1080\1090\1086" then "\1084\1086\1074\1073\1080\1090\1086":[drop 4 us]+    else if take 2 us == "\1073\1080" then "\1084\1086\1074\1073\1080":[drop 2 us] else snd (howConcat1WordEntirely "\1084\1086\1074" us)),+    ("\1085\1072\1074", howConcat1Word 3 us "\1110\1090\1100" "\1085\1072\1074\1110\1090\1100" xs),+    ("\1085\1072\1089", howConcat1Word 6 us "\1082\1110\1083\1100\1082\1080" "\1085\1072\1089\1082\1110\1083\1100\1082\1080" xs),+    ("\1085\1072\1095", if take 4 us == "\1077\1073\1090\1086" then "\1085\1072\1095\1077\1073\1090\1086":[drop 4 us]+    else if take 2 us == "\1077\1073" then "\1085\1072\1095\1077\1073":[drop 2 us] else if take 1 us == "\1077"+    then "\1085\1072\1095\1077":[drop 1 us] else [xs]),("\1085\1077\1074", howConcat1Word 2 us "\1078\1077" "\1085\1077\1074\1078\1077" xs),+    ("\1085\1077\1079", if take 9 us == "\1072\1083\1077\1078\1085\1086\1074\1110\1076" then "\1085\1077\1079\1072\1083\1077\1078\1085\1086\1074\1110\1076":[drop 9 us] else+    if take 13 us == "\1074\1072\1078\1072\1102\1095\1080\1085\1072\1090\1077\1097\1086" then "\1085\1077\1079\1074\1072\1078\1072\1102\1095\1080\1085\1072\1090\1077\1097\1086":[drop 13 us]+    else [xs]),("\1085\1077\1084", if take 6 us == "\1086\1074\1073\1080\1090\1086" then "\1085\1077\1084\1086\1074\1073\1080\1090\1086":[drop 6 us]+    else if take 4 us == "\1086\1074\1073\1080" then "\1085\1077\1084\1086\1074\1073\1080":[drop 4 us] else+    if take 2 us == "\1086\1074" then "\1085\1077\1084\1086\1074":[drop 2 us] else [xs]),+    ("\1085\1077\1085", if take 6 us == "\1072\1095\1077\1073\1090\1086" then "\1085\1077\1085\1072\1095\1077\1073\1090\1086":[drop 6 us]+    else if take 3 us == "\1072\1095\1077" then "\1085\1077\1085\1072\1095\1077":[drop 3 us] else [xs]),+    ("\1085\1077\1093", howConcat1Word 2 us "\1072\1081" "\1085\1077\1093\1072\1081" xs),+    ("\1085\1110\1073", if take 3 us == "\1080\1090\1086" then "\1085\1110\1073\1080\1090\1086":[drop 3 us] else+    if take 1 us == "\1080" then "\1085\1110\1073\1080":[drop 1 us] else [xs]),howConcat1WordEntirely "\1085\1110\1078" us,+    ("\1086\1090\1078", howConcat1Word 1 us "\1077" "\1086\1090\1078\1077" xs),("\1086\1090\1086", howConcat1Word 1 us "\1078" "\1086\1090\1086\1078" xs),+    ("\1087\1086\1087", if take 6 us == "\1088\1080\1090\1077\1097\1086" then "\1087\1086\1087\1088\1080":"\1090\1077":"\1097\1086":[drop 6 us] else [xs]),+    ("\1087\1088\1080", if take 4 us == "\1090\1086\1084\1091" then "\1087\1088\1080\1090\1086\1084\1091":[drop 4 us]+    else if take 3 us == "\1090\1110\1084" then "\1087\1088\1080\1090\1110\1084":[drop 3 us] else+    if take 5 us == "\1094\1100\1086\1084\1091" then "\1087\1088\1080\1094\1100\1086\1084\1091":[drop 5 us] else+    if take 4 us == "\1095\1086\1084\1091" then "\1087\1088\1080\1095\1086\1084\1091":[drop 4 us] else+    if take 3 us == "\1095\1110\1084" then "\1087\1088\1080\1095\1110\1084":[drop 3 us] else [xs]),+    ("\1087\1088\1086", howConcat1Word 2 us "\1090\1077" "\1087\1088\1086\1090\1077" xs),+    ("\1087\1110\1089", if take 8 us == "\1083\1103\1090\1086\1075\1086\1103\1082" then "\1087\1110\1089\1083\1103":"\1090\1086\1075\1086":"\1103\1082":[drop 8 us]+    else [xs]), ("\1089\1072\1084", howConcat1Word 1 us "\1077" "\1089\1072\1084\1077" xs),+    ("\1089\1077\1073", howConcat1Word 2 us "\1090\1086" "\1089\1077\1073\1090\1086" xs),+    ("\1090\1072\1082", if take 1 us == "\1080" then "\1090\1072\1082\1080":[drop 1 us] else+    if take 3 us == "\1081\1072\1082" then "\1090\1072\1082":"\1103\1082":[drop 3 us] else+    if take 2 us == "\1097\1086" then "\1090\1072\1082":"\1097\1086":[drop 2 us] else [xs]),+    ("\1090\1080\1084", if take 8 us == "\1095\1072\1089\1086\1084\1081\1072\1082"+    then "\1090\1080\1084":"\1095\1072\1089\1086\1084":"\1103\1082":[drop 8 us] else [xs]),+    ("\1090\1086\1073", howConcat1Word 2 us "\1090\1086" "\1090\1086\1073\1090\1086" xs),+    ("\1090\1086\1084", if take 3 us == "\1091\1097\1086" then "\1090\1086\1084\1091":"\1097\1086":[drop 3 us]+    else if take 3 us == "\1091\1103\1082" then "\1090\1086\1084\1091":"\1103\1082":[drop 3 us] else [xs]),+    ("\1090\1110\1083", howConcat1Word 3 us "\1100\1082\1080" "\1090\1110\1083\1100\1082\1080" xs),+    ("\1091\1079\1074", if take 6 us == "\1081\1072\1079\1082\1091\1079" then "\1091":"\1079\1074\x02BC\1103\1079\1082\1091":"\1079":[drop 6 us] else [xs]),+    ("\1091\1084\1110", if take 8 us == "\1088\1091\1090\1086\1075\1086\1103\1082" then "\1091":"\1084\1110\1088\1091":"\1090\1086\1075\1086":"\1103\1082":[drop 8 us]+    else [xs]), howConcat1WordEntirely "\1093\1072\1081" us,("\1093\1086\1095", if take 2 us == "\1073\1080"+    then "\1093\1086\1095":"\1073\1080":[drop 2 us] else if take 2 us == "\1072\1073" then "\1093\1086\1095\1072":"\1073":[drop 2 us] else "\1093\1086\1095":[us]),+    ("\1093\1110\1073", howConcat1Word 1 us "\1072" "\1093\1110\1073\1072" xs),+    ("\1094\1077\1073", howConcat1Word 2 us "\1090\1086" "\1094\1077\1073\1090\1086" xs),+    ("\1095\1077\1088", if take 6 us == "\1077\1079\1090\1077\1097\1086" then "\1095\1077\1088\1077\1079":"\1090\1077":"\1097\1086":[drop 6 us] else [xs]),+    howConcat1WordEntirely "\1097\1086\1073" us, ("\1103\1082\1073", howConcat1Word 1 us "\1080" "\1103\1082\1073\1080" xs),+    ("\1103\1082\1088", howConcat1Word 2 us "\1072\1079" "\1103\1082\1088\1072\1079" xs),+    ("\1103\1082\1097", howConcat1Word 1 us "\1086" "\1103\1082\1097\1086" xs)] ts+      where (ts,us) = splitAt 3 xs++howConcat1Word :: Int -> String -> String -> String -> String -> [String]+howConcat1Word n us us' us'' xs+  | take n us == us' = us'':[drop n us]+  | otherwise = [xs]+{-# INLINE howConcat1Word #-}++howConcat1WordEntirely :: String -> String -> (String, [String])+howConcat1WordEntirely ts us = (ts,ts:[us])+{-# INLINE howConcat1WordEntirely #-}
phonetic-languages-plus.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/  name:                phonetic-languages-plus-version:             0.2.0.0+version:             0.3.0.0 synopsis:            Some common shared between different packages functions. description:         Among them are the uniqueness-periods-vector series. homepage:            https://hackage.haskell.org/package/phonetic-languages-plus@@ -18,18 +18,27 @@ cabal-version:       >=1.10  library-  exposed-modules:     Languages.UniquenessPeriods.Vector.AuxiliaryG, Data.Statistics.RulesIntervals,  Data.Statistics.RulesIntervalsPlus+  exposed-modules:     Languages.UniquenessPeriods.Vector.AuxiliaryG, Data.Statistics.RulesIntervals,  Data.Statistics.RulesIntervalsPlus, Distribution.Processment, Ukrainian.ReverseConcatenations   -- other-modules:-  other-extensions:    BangPatterns-  build-depends:       base >=4.7 && <4.15, lists-flines >=0.1.1 && <1+  other-extensions:    CPP, BangPatterns+  build-depends:       base >=4.7 && <4.16, bytestring >= 0.10 && < 0.14, lists-flines >=0.1.1 && <1, mmsyn2-array >= 0.1.3 && <1, mmsyn5 >= 0.5 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4   -- hs-source-dirs:   default-language:    Haskell2010  executable distributionTextG   main-is:             Main.hs-  other-modules:       Data.Statistics.RulesIntervals, Data.Statistics.RulesIntervalsPlus-  other-extensions:    CPP, BangPatterns-  build-depends:       base >=4.7 && <4.15, bytestring >=0.10 && <0.13, lists-flines >=0.1.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4+  other-modules:       Data.Statistics.RulesIntervals, Data.Statistics.RulesIntervalsPlus, Distribution.Processment+  other-extensions:    CPP+  build-depends:       base >=4.7 && <4.16, bytestring >= 0.10 && < 0.14, lists-flines >=0.1.1 && <1, uniqueness-periods-vector-stats >=0.2.1 && <1, parallel >=3.2.0.6 && <4   ghc-options:         -threaded -rtsopts   hs-source-dirs:      ., Distribution+  default-language:    Haskell2010++executable unconcatUkr+  main-is:             Main.hs+  other-modules:       Ukrainian.ReverseConcatenations+  other-extensions:    CPP+  build-depends:       base >=4.7 && <4.16, mmsyn2-array >= 0.1.3 && <1, mmsyn5 >= 0.5 && <1+  ghc-options:         -threaded -rtsopts+  hs-source-dirs:      ., Ukrainian   default-language:    Haskell2010