phonetic-languages-plus 0.4.1.0 → 0.5.0.0
raw patch · 4 files changed
+32/−19 lines, 4 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
- Distribution.Processment: generalInfo1 :: Int -> [(Int, Int)] -> (Double, Double) -> [Double] -> String
+ Distribution.Processment: generalInfo1 :: Bool -> Int -> [(Int, Int)] -> (Double, Double) -> [Double] -> String
- Distribution.Processment: innerProc :: Bool -> String -> String -> ByteString -> IO ()
+ Distribution.Processment: innerProc :: Bool -> Bool -> String -> String -> ByteString -> IO ()
Files
- ChangeLog.md +6/−0
- Distribution/Main.hs +5/−3
- Distribution/Processment.hs +18/−13
- phonetic-languages-plus.cabal +3/−3
ChangeLog.md view
@@ -29,3 +29,9 @@ ## 0.4.1.0 -- 2021-09-08 * Fourth version revised A. Fixed issue with missing pragma for bang patterns in the Main.hs file.++## 0.5.0.0 -- 2021-10-23++* Fifth version. Changed the boundaries for the maximum number of words accordingly to the pairwise permutations case only. +Added the possibility to handle both pairwise and universal permutations set. Updated the dependencies boundaries. +
Distribution/Main.hs view
@@ -40,11 +40,13 @@ main :: IO () main = do- args0 <- getArgs- let !args = filter (/= "+W") args0+ args00 <- getArgs+ let !args0 = filter (/= "+p") args00+ !pairwisePermutations = any (== "+p") args00+ !args = filter (/= "+W") args0 !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 pairwisePermutations whitelines gzS printInput contents
Distribution/Processment.hs view
@@ -52,8 +52,8 @@ #endif #endif -innerProc :: Bool -> String -> String -> B.ByteString -> IO ()-innerProc whitelines gzS printInput contents = do+innerProc :: Bool -> Bool -> String -> String -> B.ByteString -> IO ()+innerProc pairwisePermutations 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@@ -63,9 +63,12 @@ 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+ 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..(if pairwisePermutations then 10 else 7)],replicate 102 x]+ putStrLn . generalInfo1 pairwisePermutations gz pairs (mean1, disp) $ data31 putStrLn (h False '~') putStrLn (h True '=') @@ -83,14 +86,16 @@ !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 =+generalInfo1 :: Bool -> Int -> [(Int,Int)] -> (Double,Double) -> [Double] -> String+generalInfo1 pairwisePermutations 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 '*']+ 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..(if pairwisePermutations then 10 else 7)], newLineEnding, replicate 102 '*'] {-# INLINE generalInfo1 #-}-
phonetic-languages-plus.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-plus-version: 0.4.1.0+version: 0.5.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@@ -21,7 +21,7 @@ exposed-modules: Languages.UniquenessPeriods.Vector.AuxiliaryG, Data.Statistics.RulesIntervals, Data.Statistics.RulesIntervalsPlus, Distribution.Processment -- other-modules: other-extensions: CPP, BangPatterns- 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+ build-depends: base >=4.8 && <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 -- hs-source-dirs: default-language: Haskell2010 @@ -29,7 +29,7 @@ main-is: Main.hs other-modules: Data.Statistics.RulesIntervals, Data.Statistics.RulesIntervalsPlus, Distribution.Processment other-extensions: CPP, BangPatterns- 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+ build-depends: base >=4.8 && <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