dobutokO-poetry-general-0.1.0.0: Helps to order the 7 or less words (first of all the Ukrainian ones) to obtain somewhat suitable for poetry or music text

Copyright(c) OleksandrZhabenko 2020
LicenseMIT
StabilityExperimental
Safe HaskellNone
LanguageHaskell2010

DobutokO.Poetry.Norms

Contents

Description

Maintainer : olexandr543@yahoo.com

Helps to order the 7 or less (in the first version the Ukrainian) words (or their concatenations) to obtain (to some extent) suitable for poetry or music text. This module provides several different norms that allow to research the text and to create interesting sequences.

Synopsis

Different norms

norm1 :: [Int] -> Int Source #

The first norm for the list of non-negative Int. For not empty lists equals to the maximum element.

norm2 :: [Int] -> Int Source #

The second norm for the list of non-negative Int. For not empty lists equals to the sum of the elements.

norm3 :: [Int] -> Int Source #

The third norm for the list of non-negative Int. For not empty lists equals to the sum of the doubled maximum element and the rest elements of the list.

norm4 :: [Int] -> Int Source #

The fourth norm for the list of non-negative Int. Equals to the sum of the norm3 and norm2.

norm5 :: [Int] -> Int Source #

The fifth norm for the list of non-negative Int. For not empty lists equals to the sum of the elements quoted with sum of the two most minimum elements.

norm51 :: [Int] -> Int Source #

The fifth modified norm for the list of non-negative Int. Tries to take into account doubled and prolonged sounds to reduce their influence on the norm5.

norm513 :: [Int] -> Int Source #

The fifth modified (with three minimums) norm for the list of non-negative Int. Tries to take into account doubled and prolonged sounds to reduce their influence on the norm5.

norm54 :: [Int] -> Int Source #

The fifth-fourth norm for the list of non-negative Int. Tries to generate more suitable for poetry text.

norm6 :: [Int] -> Int Source #

The sixth norm for the list of non-negative Int.

norm6r :: [Int] -> Int Source #

The sixth modified norm for the list of non-negative Int.

norm8 :: [Int] -> Int Source #

The eigth norm for the list of the non-negative Int. Similarly to norm4 is used to quickly evaluate the possibly more diverse texts, which are not simple to quickly pronounce. Is not informative (and therefore, is not intended to be used) for the lists of no more than 1 element.

Norms combining

splitNorm :: [Int] -> Vector ([Int] -> Int) -> [Int] Source #

Splits a given list of non-negative integers into lists of elements not equal to zero and then applies to them the norms from the Vector starting from the last element in the vector right-to-left.

More complex combining

combineNorms :: [Int] -> Vector ([Int] -> Int) -> [Int] Source #

Applies all the given norms in the Vector to the first argument and collects the result as a list.

flSplitNorms :: Vector ([Int] -> Int) -> [Int] -> [Int] Source #

The flipped variant of the combineNorms (can be more convenient for applications).

normSplit :: Vector ([Int] -> Int) -> [Int] -> Int Source #

Using combineNorms and given a group of norms (represented as a Vector) returns the sum of their applications. These norms are equally important and their order can be volatile.

normSplitWeighted :: [Int] -> Vector ([Int] -> Int) -> [Int] -> Int Source #

Using combineNorms and given a group of norms (represented as a Vector) returns the sum of their applications. The importance of these norms can be easily controlled by the first function argument. The corresponding greater numbers in the first argument list signify the greater importance of the norm in the Vector of norms all being applied (so these numbers are multiplicative weights in the sum). If some of the numbers are equal to zero then the corresponding norm is not taken into account. If some of the numbers are negative then the corresponding norms are weightly subtracted from the sum.

normSplitShifted :: [Int] -> Vector ([Int] -> Int) -> [Int] -> Int Source #

Similar to normSplitWeighted, but uses more complex modification instead of multiplication. Using splitNorm and given a group of norms (represented as a Vector) returns the sum of their applications. The importance of these norms can be controlled by the first function argument. The corresponding greater numbers in the first argument list signify the greater importance of the norm in the Vector of norms all being applied. If some of the numbers are negative then the corresponding norms reduces the sum in some way.

normSplitWeightedG :: (Int -> Int -> Int) -> [Int] -> Vector ([Int] -> Int) -> [Int] -> Int Source #

Generalization for the normSplitWeighted and normSplitShifted with the possibility to define and use the volatile function that influences the weights for the norms in the Vector. This function used in the zipWith is given as the first argument.