uniqueness-periods-vector-examples 0.3.1.1 → 0.4.0.0
raw patch · 4 files changed
+55/−10 lines, 4 filesdep +uniqueness-periods-vector-filters
Dependencies added: uniqueness-periods-vector-filters
Files
- ChangeLog.md +5/−0
- Proportion/Main.hs +25/−7
- README.md +22/−0
- uniqueness-periods-vector-examples.cabal +3/−3
ChangeLog.md view
@@ -28,3 +28,8 @@ ## 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.++## 0.4.0.0 -- 2020-09-17++* Fourth version. Added a README.md file. Changed the behaviour of the uniqVec03 executable so that it is more accurate and gives more output information. +Added links to results of the processment for the Ukrainian poetic original and translated-into texts.
Proportion/Main.hs view
@@ -6,7 +6,9 @@ -- 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. +-- then for the whole poem prints the hypothesis evaluation information. Since the 0.4.0.0 version +-- 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. module Main where @@ -20,7 +22,10 @@ import Languages.UniquenessPeriods.Vector.Data import Languages.UniquenessPeriods.Vector.Auxiliary import Languages.UniquenessPeriods.Vector.StrictV-import Numeric+import Numeric (showFFloat)+import Languages.UniquenessPeriods.Vector.Filters+import GHC.Float (int2Float)+import Data.List (sort) main :: IO () main = do@@ -34,13 +39,26 @@ 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 - let ratio = 2.0 * fromIntegral data2 / fromIntegral (minE + maxE)+ let ratio = if maxE == 1 then 0 else 2.0 * fromIntegral data2 / fromIntegral (minE + maxE)+ intervalN = if maxE == 1 then 0 else intervalNRealFrac (int2Float minE) (int2Float maxE) 9 (int2Float data2) 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)) ""+ showFFloat (Just 3) ratio "\t" ++ show (length . words $ ts) ++ "\t" ++ show intervalN+ return (ratio,intervalN)) $ flines+ let (data31,data32) = unzip data3 + data4 = filter (/= 0) data31+ if null data4 then putStrLn "-----------------------------------------------------------------------------------------------------" >> putStrLn "1.000+-0.000\t0" >> + putStrLn "=====================================================================================================" -- 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 = sum data4 / fromIntegral (length data4)+ intervals = sort . filter (/= 0) $ data32+ zeroes = length . filter (== 0) $ data31+ f xs n = show . length . takeWhile (== n) . dropWhile (/= n) $ xs+ putStrLn "-----------------------------------------------------------------------------------------------------"+ mapM_ (\r -> putStr $ show r ++ "\t") [1..9] >> putStrLn ""+ mapM_ (\r -> putStr $ f intervals r ++ "\t") [1..9] >> putStrLn ""+ putStrLn $ showFFloat (Just 3) mean1 "+-" ++ showFFloat (Just 3) (sqrt ((sum (map (**2) data4) / fromIntegral (length data4)) - mean1 ** 2)) "\t" ++ show zeroes+ putStrLn "=====================================================================================================" isUkrainian :: Char -> Bool isUkrainian x
+ README.md view
@@ -0,0 +1,22 @@+These files are created by the uniqVec03 executable after Lynx dumping the web pages from the links on the following pages: ++TarasShevchenko -- http://poetyka.uazone.net/kobzar/zmist.html+IvanFranko -- http://poetyka.uazone.net/franko/+OleksandrOles -- http://poetyka.uazone.net/oles/+PavloTychyna -- http://poetyka.uazone.net/tychina/+VolodymyrSosura -- http://poetyka.uazone.net/sosura/+LinaKostenko -- http://poetyka.uazone.net/kostenko/+WilliamShakespeare -- http://poetyka.uazone.net/shakespeare/ (the last one is translation of the original English versions into Ukrainian).++The version of the uniqueness-periods-vector-examples used for them is 0.3.1.1++The processment was done by Oleksandr Zhabenko, the author of the packages from uniqueness-periods-vector series. ++The zip archive can be downloaded from the link:++https://web.archive.org/web/20200917200032/https://raw.githubusercontent.com/OleksandrZhabenko/uniqueness-periods-vector-examples/master/0.3.1.1.zip++or from GitHub page: ++https://github.com/OleksandrZhabenko/uniqueness-periods-vector-examples/blob/master/0.3.1.1.zip+
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.1+version: 0.4.0.0 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@@ -14,7 +14,7 @@ copyright: Oleksandr Zhabenko category: Language, Math, Game build-type: Simple-extra-source-files: ChangeLog.md+extra-source-files: ChangeLog.md, README.md cabal-version: >=1.10 executable uniqVec01@@ -37,6 +37,6 @@ main-is: Main.hs -- other-modules: -- other-extensions:- build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-general >=0.4.2 && < 1, uniqueness-periods-vector-common >=0.3 && <1, uniqueness-periods-vector-properties >=0.3.1 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2 && <1+ build-depends: base >=4.7 && <4.15, mmsyn6ukr >=0.8 && <1, vector >=0.11 && <0.14, uniqueness-periods-vector >=0.3 && <1, uniqueness-periods-vector-general >=0.4.2 && < 1, uniqueness-periods-vector-common >=0.3 && <1, uniqueness-periods-vector-properties >=0.3.1 && <1, print-info >=0.1.3 && <1, phonetic-languages-ukrainian >=0.2 && <1, uniqueness-periods-vector-filters >=0.1.1 && <1 hs-source-dirs: Proportion default-language: Haskell2010