summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandrZhabenko <>2020-09-15 19:41:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-09-15 19:41:00 (GMT)
commit158d5d18c8180dae8f6571fef1506d549ab3b944 (patch)
tree5688de9c69490c5687d0393abc1f431fa454eed6
parentdcff87275b3800cd8d11ba6c29d09557ae2b62e3 (diff)
version 0.3.1.00.3.1.0
-rw-r--r--ChangeLog.md4
-rw-r--r--Proportion/Main.hs8
-rw-r--r--uniqueness-periods-vector-examples.cabal2
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index 1d0767b..d27431d 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -20,3 +20,7 @@
* Third version. Added a new executable uniqVec03. It tests a hypothesis that for many Ukrainian poems (for example, by Oleksandr Oles) the actual
diverse2 output lies close between midpoint between the minimum and maximum possible for that line values.
+
+## 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.
diff --git a/Proportion/Main.hs b/Proportion/Main.hs
index bf7613f..6cba073 100644
--- a/Proportion/Main.hs
+++ b/Proportion/Main.hs
@@ -5,7 +5,7 @@
-- Stability : Experimental
-- Maintainer : olexandr543@yahoo.com
--
--- Analyzez a poetic text in Ukrainian for every line prints statistic data and
+-- Analyzes a poetic text in Ukrainian, for every line prints statistic data and
-- then for the whole poem prints the hypothesis evaluation information.
module Main where
@@ -28,7 +28,7 @@ main = do
args <- getArgs
let file = concat . take 1 $ args
contents <- readFile file
- let flines = filter (not . null . filter isAlpha) . prepareText $ contents
+ let flines = filter (not . null . filter isAlpha . 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)
@@ -42,3 +42,7 @@ main = do
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)) ""
+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
+ | otherwise = False
diff --git a/uniqueness-periods-vector-examples.cabal b/uniqueness-periods-vector-examples.cabal
index cb655cc..d278ac3 100644
--- a/uniqueness-periods-vector-examples.cabal
+++ b/uniqueness-periods-vector-examples.cabal
@@ -3,7 +3,7 @@
-- http://haskell.org/cabal/users-guide/
name: uniqueness-periods-vector-examples
-version: 0.3.0.0
+version: 0.3.1.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