uniqueness-periods-vector-examples 0.1.3.0 → 0.2.0.0
raw patch · 3 files changed
+72/−2 lines, 3 filesdep ~uniqueness-periods-vector-generalnew-component:exe:uniqVec02
Dependency ranges changed: uniqueness-periods-vector-general
Files
- ChangeLog.md +4/−0
- Lines/Main.hs +58/−0
- uniqueness-periods-vector-examples.cabal +10/−2
ChangeLog.md view
@@ -11,3 +11,7 @@ ## 0.1.3.0 -- 2020-09-12 * First version revised C. Changed the dependency boundaries for some changed packages from the uniqueness-periods-vector series. Made the needed code changes. ++## 0.2.0.0 -- 2020-09-13++* Second version. Changed the dependency boundaries of the uniqueness-periods-vector-general package. Added a new executable uniqVec02.
+ Lines/Main.hs view
@@ -0,0 +1,58 @@+-- |+-- Module : Main+-- Copyright : (c) OleksandrZhabenko 2020+-- License : MIT+-- Stability : Experimental+-- Maintainer : olexandr543@yahoo.com+--+-- Inspired by: https://functional-art.org/2020/papers/Poetry-OleksandrZhabenko.pdf from the https://functional-art.org/2020/performances ; +-- Allows to rewrite the given text (usually a poetical one). ++module Main where++import qualified Data.Vector as V+import Data.List (intercalate,intersperse)+import System.IO+import String.Languages.UniquenessPeriods.Vector+import Languages.UniquenessPeriods.Vector.General.Debug+import Languages.UniquenessPeriods.Vector.Properties+import Melodics.Ukrainian+import System.Environment+import Languages.Phonetic.Ukrainian.PrepareText+import Languages.UniquenessPeriods.Vector.Data+import Languages.UniquenessPeriods.Vector.Auxiliary++main :: IO ()+main = do+ args <- getArgs+ let file = concat . take 1 $ args+ contents <- readFile file+ let flines = prepareText contents+ lasts = map (\ts -> if null . words $ ts then [] else last . words $ ts) flines+ zs = lastFrom3 . headU2 . fst . get22 . uniqNProperties2GN " 01-" (PA [] (concat . take 1 $ lasts)) 1 1 (V.singleton (oneProperty)) (uniquenessPeriodsVector3 " 01-" . + aux0 . convertToProperUkrainian) (justOneValue2Property . diverse2) . unwords . init . words . concat . take 1 $ flines + toFile (file ++ "new.txt") (zs:(noDoubleWords . circle2 (concat . take 1 $ lasts) . drop 1 $ flines))++circle2 :: String -> [String] -> [String]+circle2 xs xss+ | null xss = []+ | otherwise = let (zss,tss) = splitAt 1 xss in do+ let rs = words . concat $ zss+ ws = lastFrom3 . headU2 . fst . get22 . + uniqNProperties2GN " 01-" (PA xs (if null rs then [] else last rs)) 1 1 (V.singleton (oneProperty)) (uniquenessPeriodsVector3 " 01-" . + aux0 . convertToProperUkrainian) (justOneValue2Property . diverse2) . unwords $ + if null rs then [] else init rs in ws:circle2 (if null rs then [] else last rs) tss++headU2 :: [UniquenessG1 a b] -> UniquenessG1 a b+headU2 zs + | null zs = ([],V.empty,[])+ | otherwise = head zs++noDoubleWords :: [String] -> [String]+noDoubleWords xss = map (unwords . drop 1 . words) xss++-- | Auxiliary printing function to define the line ending needed to be printed by 'printUniquenessG1List' function in some cases. +newLineEnding :: String+newLineEnding + | nativeNewline == LF = "\n"+ | otherwise = "\r\n"
uniqueness-periods-vector-examples.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: uniqueness-periods-vector-examples-version: 0.1.3.0+version: 0.2.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@@ -21,6 +21,14 @@ 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.1 && < 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 hs-source-dirs: Simple+ default-language: Haskell2010++executable uniqVec02+ 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+ hs-source-dirs: Lines default-language: Haskell2010