uniqueness-periods-vector-examples 0.12.3.0 → 0.12.3.1
raw patch · 4 files changed
+27/−23 lines, 4 filesdep ~uniqueness-periods-vectordep ~uniqueness-periods-vector-commonPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: uniqueness-periods-vector, uniqueness-periods-vector-common
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Lines/Main.hs +9/−9
- Proportion/Main.hs +9/−9
- uniqueness-periods-vector-examples.cabal +5/−5
ChangeLog.md view
@@ -137,3 +137,7 @@ * Twelfth version revised C. Improved printing of the output for the processText executable, used for this a new function precChoice. Fixed issue with dependency function uniquenessVariants2GNP that influenced all the related functionality.++## 0.12.3.1 -- 2020-10-14++* Twelfth version revised D. Some code improvements.
Lines/Main.hs view
@@ -47,24 +47,24 @@ args <- getArgs let !numericArgs = filter (all isDigit) . drop 2 $ args !choice = concat . drop 1 . take 2 $ args- !numberI = fromMaybe 1 $ (readMaybe (concat . take 1 $ numericArgs)::Maybe Int)+ !numberI = fromMaybe 1 (readMaybe (concat . take 1 $ numericArgs)::Maybe Int) !file = concat . take 1 $ args contents <- readFile file let !flines = prepareText contents !lasts = map (\ts -> if null . words $ ts then [] else last . words $ ts) flines if compare numberI 2 == LT then do let !zs = if compare (length . words . concat . take 1 $ flines) 3 == LT then concat . take 1 $ flines else lastFrom3 . headU2 . fst . get22 .- uniqNProperties2GN " 01-" (PA [] (concat . take 1 $ lasts)) 1 1 (V.singleton (oneProperty)) (chooseMax choice) . unwords . init . words . concat . take 1 $ flines+ uniqNProperties2GN " 01-" (PA [] (concat . take 1 $ lasts)) 1 1 (V.singleton oneProperty) (chooseMax choice) . unwords . init . words . concat . take 1 $ flines toFile (file ++ "new.txt") (zs:(noDoubleWords . circle2 (concat . take 1 $ lasts) choice [] . drop 1 $ flines)) else do let !intervalNmbrs = (\vs -> if null vs then V.singleton numberI else V.uniq . V.fromList $ vs) . sort . filter (<= numberI) .- map (\t -> fromMaybe numberI $ (readMaybe t::Maybe Int)) . drop 2 $ numericArgs+ map (\t -> fromMaybe numberI (readMaybe t::Maybe Int)) . drop 2 $ numericArgs !us = words . concat . take 1 $ flines !xs = if compare (length us) 2 == LT then [] else unwords . init $ us- (!maxE,!minE) = runEval ((parTuple2 rpar rpar) ((\k -> if k == 0.0 then 1.0 else k) . (\rs -> if null rs then 0.0 else head rs) . firstFrom3 .- maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty)) (chooseMax choice) $ xs), (\k -> if k == 0.0 then 1.0 else k) . abs . (\rs -> if null rs then 0.0 else head rs) .- firstFrom3 . maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty))- (chooseMin choice) $ xs)))+ (!maxE,!minE) = runEval (parTuple2 rpar rpar ((\k -> if k == 0.0 then 1.0 else k) . (\rs -> if null rs then 0.0 else head rs) . firstFrom3 .+ maximumElBy 1 (V.singleton oneProperty) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton oneProperty) (chooseMax choice) $ xs), (\k -> if k == 0.0 then 1.0 else k) . abs .+ (\rs -> if null rs then 0.0 else head rs) . firstFrom3 . maximumElBy 1 (V.singleton oneProperty) $+ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton oneProperty) (chooseMin choice) $ xs))) !zs = if compare (length . words . concat . take 1 $ flines) 3 == LT then concat . take 1 $ flines else lastFrom3 . headU2 . fst . get22 . uniqNProperties2GN " 01-" (PA [] (concat . take 1 $ lasts)) 1 1 (V.singleton (unsafeSwapVecIWithMaxI minE maxE numberI intervalNmbrs . oneProperty)) (chooseMax choice) .@@ -79,7 +79,7 @@ where (!zss,!tss) = splitAt 1 xss !rs = words . concat $ zss !ws = if compare (length rs) 3 == LT then unwords (xs:rs) else lastFrom3 . headU2 . fst . get22 .- uniqNProperties2GN " 01-" (PA xs (if null rs then [] else last rs)) 1 1 (V.singleton (oneProperty)) (chooseMax choice) . unwords . init $ rs+ uniqNProperties2GN " 01-" (PA xs (if null rs then [] else last rs)) 1 1 (V.singleton oneProperty) (chooseMax choice) . unwords . init $ rs -- | Processment with rearrangements. circle2I :: String -> String -> [String] -> Int -> V.Vector Int -> Float -> Float -> [String] -> [String]@@ -99,5 +99,5 @@ {-# INLINE headU2 #-} noDoubleWords :: [String] -> [String]-noDoubleWords xss = map (unwords . drop 1 . words) xss+noDoubleWords = map (unwords . drop 1 . words) {-# INLINE noDoubleWords #-}
Proportion/Main.hs view
@@ -84,7 +84,7 @@ innerProc printLine choice flines gzS else let tau !k = (let !flines1 = fLines k contents in innerProc printLine choice flines1 gzS) in case twoInParallel of- 1 -> ($|) (mapM_ id) rpar (map tau [1, 0])+ 1 -> ($|) sequence_ rpar (map tau [1, 0]) _ -> mapM_ tau [1, 0] innerProc :: Int -> String -> [String] -> String -> IO ()@@ -96,9 +96,9 @@ else do let (!mean1,!disp) = meanWithDisp 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` rseq+ 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]- mapM_ putStrLn . map snd $ data31+ mapM_ (putStrLn . snd) data31 putStrLn . generalInfo1 gz pairs (mean1, disp) $ data31 putStrLn (h False '~') putStrLn (h True '=')@@ -112,15 +112,15 @@ getData3 :: Int -> Int -> String -> [String] -> [((Float,String),(Int,Int))] getData3 printLine gz choice = parMap rseq (\ts ->- let (!maxE,!minE,!data2) = runEval ((parTuple3 rpar rseq rseq) ((\k -> if k == 0.0 then 1.0 else k) . (\rs -> if null rs then 0.0 else head rs) . firstFrom3 .- maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty)) (chooseMax choice) $ ts), (\k -> if k == 0.0 then 1.0 else k) . abs . (\rs -> if null rs then 0.0 else head rs) .- firstFrom3 . maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty))- (chooseMin choice) $ ts),+ let (!maxE,!minE,!data2) = runEval (parTuple3 rpar rpar rpar ((\k -> if k == 0.0 then 1.0 else k) . (\rs -> if null rs then 0.0 else head rs) . firstFrom3 .+ maximumElBy 1 (V.singleton oneProperty) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton oneProperty) (chooseMax choice) ts), (\k -> if k == 0.0 then 1.0 else k) . abs . (\rs -> if null rs then 0.0 else head rs) .+ firstFrom3 . maximumElBy 1 (V.singleton oneProperty) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton oneProperty)+ (chooseMin choice) ts), (\k -> if k == 0.0 then 1.0 else k) . head . getAC (chooseMax choice) $ ts)) (!wordsN,!intervalN) | maxE == 1 = (0, 0)- | otherwise = runEval ((parTuple2 rpar rpar) (length . words $ ts, intervalNRealFrac minE maxE gz data2))- (!ratio,!printedLine) = (if maxE == 1.0 then 0.0 else 2.0 * data2 / (minE + maxE), mconcat [showFFloat (precChoice choice) minE $ "\t",+ | otherwise = runEval (parTuple2 rpar rpar (length . words $ ts, intervalNRealFrac minE maxE gz data2))+ (!ratio,!printedLine) = (if maxE == 1.0 then 0.0 else 2.0 * data2 / (minE + maxE), mconcat [showFFloat (precChoice choice) minE "\t", showFFloat (precChoice choice) data2 "\t", showFFloat (precChoice choice) maxE "\t", showFFloat (Just 4) (data2 / minE) "\t", showFFloat (Just 4) (maxE / data2) "\t", showFFloat (Just 4) ratio "\t", '\t':show (wordsN::Int), '\t':show (intervalN::Int), if printLine == 1 then '\t':ts else ""]) in ((ratio,printedLine),(wordsN,intervalN)))
uniqueness-periods-vector-examples.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: uniqueness-periods-vector-examples-version: 0.12.3.0+version: 0.12.3.1 synopsis: Usage examples for the uniqueness-periods-vector series of packages description: Usage examples for the uniqueness-periods-vector series of packages. Several executables are planned to demonstrate the libraries work. homepage: https://hackage.haskell.org/package/uniqueness-periods-vector-examples@@ -21,7 +21,7 @@ exposed-modules: Languages.UniquenessPeriods.Vector.FuncRepRelated, Data.Statistics.RulesIntervals -- other-modules: other-extensions: BangPatterns- build-depends: base >=4.7 && <4.15, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-common >=0.5.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, lists-flines >=0.1.1 && <1, vector >=0.11 && <0.14+ build-depends: base >=4.7 && <4.15, uniqueness-periods-vector >=0.3.1.1 && <1, uniqueness-periods-vector-common >=0.5.1.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, lists-flines >=0.1.1 && <1, vector >=0.11 && <0.14 -- hs-source-dirs: default-language: Haskell2010 @@ -29,7 +29,7 @@ main-is: Main.hs other-modules: Languages.UniquenessPeriods.Vector.FuncRepRelated other-extensions: BangPatterns- build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, parallel >=3.2.0.6 && <4, uniqueness-periods-vector-filters >=0.3 && <1, vector >=0.11 && <0.14+ build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3.1.1 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, parallel >=3.2.0.6 && <4, uniqueness-periods-vector-filters >=0.3 && <1, vector >=0.11 && <0.14 ghc-options: -threaded -rtsopts hs-source-dirs: ., Simple default-language: Haskell2010@@ -38,7 +38,7 @@ main-is: Main.hs other-modules: Languages.UniquenessPeriods.Vector.FuncRepRelated other-extensions: BangPatterns- build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, parallel >=3.2.0.6 && <4, uniqueness-periods-vector-filters >=0.3 && <1, vector >=0.11 && <0.14+ build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3.1.1 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, parallel >=3.2.0.6 && <4, uniqueness-periods-vector-filters >=0.3 && <1, vector >=0.11 && <0.14 ghc-options: -threaded -rtsopts hs-source-dirs: ., Lines default-language: Haskell2010@@ -47,7 +47,7 @@ main-is: Main.hs other-modules: Languages.UniquenessPeriods.Vector.FuncRepRelated, Data.Statistics.RulesIntervals other-extensions: CPP, BangPatterns, FlexibleInstances, MultiParamTypeClasses- build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, uniqueness-periods-vector-filters >=0.3 && <1, uniqueness-periods-vector-stats >=0.1.2 && <1, parallel >=3.2.0.6 && <4, lists-flines >=0.1.1 && <1, vector >=0.11 && <0.14+ build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8.1 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3.1.1 && <1, uniqueness-periods-vector-general >=0.5.1 && < 1, uniqueness-periods-vector-common >=0.5.1.1 && <1, uniqueness-periods-vector-properties >=0.5.5 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2.3 && <1, uniqueness-periods-vector-filters >=0.3 && <1, uniqueness-periods-vector-stats >=0.1.2 && <1, parallel >=3.2.0.6 && <4, lists-flines >=0.1.1 && <1, vector >=0.11 && <0.14 ghc-options: -threaded -rtsopts hs-source-dirs: ., Proportion default-language: Haskell2010