phonetic-languages-plus 0.1.0.0 → 0.1.1.0
raw patch · 2 files changed
+10/−10 lines, 2 filesdep ~uniqueness-periods-vector-statsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: uniqueness-periods-vector-stats
API changes (from Hackage documentation)
Files
Distribution/Main.hs view
@@ -6,8 +6,8 @@ -- 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 +-- 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 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@@ -62,12 +62,12 @@ innerProc :: String -> String -> B.ByteString -> IO () innerProc gzS printInput contents = do if printInput == "1" then B.putStr contents else B.putStr B.empty- (!data31,!wordsCnt0_data32) <- processContents contents + (!data31,!wordsCnt0_data32) <- processContents contents let !gz = getIntervalsN gzS data31 -- Obtained from the first command line argument except those ones that are for RTS !data4 = filter (/= 0.0) data31 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 unique (in phonetic meaning) words alongside every line. A rather rare occurrence. else do- let (!mean1,!disp) = meanWithDisp data4+ 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]@@ -82,19 +82,19 @@ | otherwise = fromMaybe 9 (readMaybe xs::(Maybe Int)) {-# INLINE getIntervalsN #-} -processContents :: B.ByteString -> IO ([Float],[(Int,Int)])+processContents :: B.ByteString -> IO ([Double],[(Int,Int)]) processContents contents = do let !anlines = B.lines contents !anStrs = 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 Float)) ratioStrs+ !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)] -> (Float,Float) -> [Float] -> String++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
phonetic-languages-plus.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-plus-version: 0.1.0.0+version: 0.1.1.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@@ -29,7 +29,7 @@ main-is: Main.hs other-modules: Data.Statistics.RulesIntervals other-extensions: CPP, BangPatterns- build-depends: base >=4.7 && <4.15, bytestring >=0.10 && <0.13, parallel >=3.2.0.6 && <4, lists-flines >=0.1.1 && <1, uniqueness-periods-vector-stats >=0.1.2 && <1+ 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, parallel >=3.2.0.6 && <4 ghc-options: -threaded -rtsopts hs-source-dirs: ., Distribution default-language: Haskell2010