packages feed

uniqueness-periods-vector-examples 0.3.1.0 → 0.3.1.1

raw patch · 3 files changed

+16/−12 lines, 3 files

Files

ChangeLog.md view
@@ -23,4 +23,8 @@  ## 0.3.1.0 -- 2020-09-15 -* Third version revised. Some code improvements for uniqVec03 executable for filtering non-Ukrainian texts parts that must not be inlined. +* Third version revised A. Some code improvements for uniqVec03 executable for filtering non-Ukrainian texts parts that must not be inlined. ++## 0.3.1.1 -- 2020-09-16++* Third version revised B. Changed the order of the output information for uniqVec03 executable, used tabutation symbols as delimiter, some code improvements.
Proportion/Main.hs view
@@ -21,28 +21,28 @@ import Languages.UniquenessPeriods.Vector.Auxiliary import Languages.UniquenessPeriods.Vector.StrictV import Numeric-import Data.Char   main :: IO () main = do   args <- getArgs   let file = concat . take 1 $ args   contents <- readFile file-  let flines = filter (not . null . filter isAlpha . filter isUkrainian) . prepareText $ contents+  let flines = filter (not . null . filter isUkrainian) . prepareText $ contents   data3 <- mapM (\ts -> do    let maxE = (\k -> if k == 0 then 1 else k) . (\rs -> if null rs then 0 else head rs) . firstFrom3 . maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty)) (uniquenessPeriodsVector3 " 01-" .                aux0 . convertToProperUkrainian) (justOneValue2Property . diverse2) $ ts)-       minE = (\k -> if k == 0 then 1 else k) .abs . (\rs -> if null rs then 0 else head rs) . firstFrom3 . maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty)) (uniquenessPeriodsVector3 " 01-" . +       minE = (\k -> if k == 0 then 1 else k) . abs . (\rs -> if null rs then 0 else head rs) . firstFrom3 . maximumElBy 1 (V.singleton (oneProperty)) $ UL2 ([],uniquenessVariants2GN " 01-" (V.singleton (oneProperty)) (uniquenessPeriodsVector3 " 01-" .                aux0 . convertToProperUkrainian) (justOneValue2Property . negate . diverse2) $ ts)-       data2 = (\k -> if k == 0 then 1 else k) .diverse2 . uniquenessPeriodsVector3 " 01-" . aux0 . convertToProperUkrainian $ ts -   putStrLn $ show (maxE::Int) ++ "    " ++ show (data2::Int) ++ "    " ++ show (minE::Int) ++ "    " ++ -     showFFloat (Just 3) (fromIntegral maxE / fromIntegral data2) "      " ++ showFFloat (Just 3) (fromIntegral data2 / fromIntegral minE) "      " ++ -       showFFloat (Just 3) (2.0 * fromIntegral data2 / fromIntegral (minE + maxE)) "      " ++ show (length . words $ ts)-   return (2.0 * fromIntegral data2 / fromIntegral (minE + maxE))) $ flines+       data2 = (\k -> if k == 0 then 1 else k) . diverse2 . uniquenessPeriodsVector3 " 01-" . aux0 . convertToProperUkrainian $ ts +   let ratio = 2.0 * fromIntegral data2 / fromIntegral (minE + maxE)+   putStrLn $ show (minE::Int) ++ "\t" ++ show (data2::Int) ++ "\t" ++ show (maxE::Int) ++ "\t" ++ +     showFFloat (Just 3) (fromIntegral data2 / fromIntegral minE) "\t" ++ showFFloat (Just 3) (fromIntegral maxE / fromIntegral data2) "\t" ++ +       showFFloat (Just 3) ratio "\t" ++ show (length . words $ ts)+   return ratio) $ flines   let mean1 = sum data3 / fromIntegral (length data3)-  putStrLn $ showFFloat (Just 3) mean1 "   +-   " ++ showFFloat (Just 3) (sqrt ((sum (map (**2) data3) / fromIntegral (length data3)) - mean1 ** 2)) ""+  putStrLn $ showFFloat (Just 3) mean1 "+-" ++ showFFloat (Just 3) (sqrt ((sum (map (**2) data3) / fromIntegral (length data3)) - mean1 ** 2)) ""    isUkrainian :: Char -> Bool isUkrainian x- | x == '\x0404' || (x >= '\x0406' && x <= '\x0407') || (x >= '\x0410' && x <= '\x0429') || x == '\x042C' || (x >= '\x042E' && x <= '\x0449') || x == '\x044C' || (x >= '\x044E' && x <= '\x044F') || x == '\x0454' || (x >= '\x0456' && x <= '\x0457') || isPunctuation x || isSpace x = True+ | x == '\x0404' || (x >= '\x0406' && x <= '\x0407') || (x >= '\x0410' && x <= '\x0429') || x == '\x042C' || (x >= '\x042E' && x <= '\x0449') || x == '\x044C' || (x >= '\x044E' && x <= '\x044F') || x == '\x0454' || (x >= '\x0456' && x <= '\x0457') = True  | otherwise = False
uniqueness-periods-vector-examples.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/  name:                uniqueness-periods-vector-examples-version:             0.3.1.0+version:             0.3.1.1 synopsis:            Examples of usage for the uniqueness-periods-vector series of packages description:         Examples of usage 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