{-# LANGUAGE CPP, BangPatterns #-}
module Phonetic.Languages.Lists.Ukrainian.PropertiesFuncRepG (
procDiverse2I
, procDiverse2Ineg
, procDiverse2F
, procDiverse2Fneg
, procRhythmicity23F
, procRhythmicity23Fneg
, procBothF
, procBothFneg
, procBothInvF
, procBothInvFneg
, procRhythmicity232F
, procRhythmicity232Fneg
, procBoth2F
, procBoth2Fneg
, procBoth2InvF
, procBoth2InvFneg
) where
#ifdef __GLASGOW_HASKELL__
#if __GLASGOW_HASKELL__>=710
/* code that applies only to GHC 7.10.* and higher versions */
import GHC.Base (mconcat)
#endif
#endif
import GHC.Int
import qualified Data.Vector as VB
import qualified Data.Vector.Unboxed as V
import Phonetic.Languages.Lists.Ukrainian.PropertiesSyllablesG
import Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG
import Languages.Rhythmicity
import Phonetic.Languages.Simplified.DataG
import GHC.Float (int2Float)
import Melodics.ByteString.Ukrainian
import qualified Languages.Phonetic.Ukrainian.Syllable as S
import Data.Maybe (isNothing,fromMaybe)
import Text.Read (readMaybe)
#ifdef __GLASGOW_HASKELL__
#if __GLASGOW_HASKELL__==708
/* code that applies only to GHC 7.8.* */
mconcat = concat
#endif
#endif
procDiverse2I
:: (Ord c) => (Int16 -> c)
-> FuncRep2 String Int16 c
procDiverse2I :: (Int16 -> c) -> FuncRep2 String Int16 c
procDiverse2I Int16 -> c
g = (String -> Int16) -> (Int16 -> c) -> FuncRep2 String Int16 c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Int16) -> (String -> String) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String
convertToProperUkrainianS) Int16 -> c
g
{-# INLINE procDiverse2I #-}
procDiverse2Ineg
:: (Ord c) => (Int16 -> c)
-> FuncRep2 String Int16 c
procDiverse2Ineg :: (Int16 -> c) -> FuncRep2 String Int16 c
procDiverse2Ineg Int16 -> c
g = (String -> Int16) -> (Int16 -> c) -> FuncRep2 String Int16 c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (Int16 -> Int16
forall a. Num a => a -> a
negate (Int16 -> Int16) -> (String -> Int16) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Int16) -> (String -> String) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String
convertToProperUkrainianS) Int16 -> c
g
{-# INLINE procDiverse2Ineg #-}
procDiverse2F
:: (Ord c) => (Float -> c)
-> FuncRep2 String Float c
procDiverse2F :: (Float -> c) -> FuncRep2 String Float c
procDiverse2F Float -> c
g = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (Int -> Float
int2Float (Int -> Float) -> (String -> Int) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Int) -> (String -> Int16) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Int16) -> (String -> String) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String
convertToProperUkrainianS) Float -> c
g
{-# INLINE procDiverse2F #-}
procDiverse2Fneg
:: (Ord c) => (Float -> c)
-> FuncRep2 String Float c
procDiverse2Fneg :: (Float -> c) -> FuncRep2 String Float c
procDiverse2Fneg Float -> c
g = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (Int -> Float
int2Float (Int -> Float) -> (String -> Int) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int
forall a. Num a => a -> a
negate (Int -> Int) -> (String -> Int) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Int) -> (String -> Int16) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Int16) -> (String -> String) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String
convertToProperUkrainianS) Float -> c
g
{-# INLINE procDiverse2Fneg #-}
procRhythmicity23F
:: (Ord c) => (Float -> c)
-> String
-> Coeffs2
-> FuncRep2 String Float c
procRhythmicity23F :: (Float -> c) -> String -> Coeffs2 -> FuncRep2 String Float c
procRhythmicity23F Float -> c
g String
choice Coeffs2
coeffs = (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23F Float -> c
g String
choice String -> Coeffs2 -> String -> Float
rhythmicity Coeffs2
coeffs
{-# INLINE procRhythmicity23F #-}
procRhythmicity23Fneg
:: (Ord c) => (Float -> c)
-> String
-> Coeffs2
-> FuncRep2 String Float c
procRhythmicity23Fneg :: (Float -> c) -> String -> Coeffs2 -> FuncRep2 String Float c
procRhythmicity23Fneg Float -> c
g String
choice Coeffs2
coeffs = (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23Fneg Float -> c
g String
choice String -> Coeffs2 -> String -> Float
rhythmicity Coeffs2
coeffs
{-# INLINE procRhythmicity23Fneg #-}
procBothF
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBothF :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBothF Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2F Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations Coeffs2
coeffs
{-# INLINE procBothF #-}
procBothFneg
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBothFneg :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBothFneg Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2Fneg Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations Coeffs2
coeffs
{-# INLINE procBothFneg #-}
procBothInvF
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBothInvF :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBothInvF Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvF Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations Coeffs2
coeffs
{-# INLINE procBothInvF #-}
procBothInvFneg
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBothInvFneg :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBothInvFneg Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvFneg Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations Coeffs2
coeffs
{-# INLINE procBothInvFneg #-}
procRhythmicity232F
:: (Ord c) => (Float -> c)
-> String
-> Coeffs2
-> FuncRep2 String Float c
procRhythmicity232F :: (Float -> c) -> String -> Coeffs2 -> FuncRep2 String Float c
procRhythmicity232F Float -> c
g String
choice Coeffs2
coeffs = (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23F Float -> c
g String
choice String -> Coeffs2 -> String -> Float
rhythmicity Coeffs2
coeffs
{-# INLINE procRhythmicity232F #-}
procRhythmicity232Fneg
:: (Ord c) => (Float -> c)
-> String
-> Coeffs2
-> FuncRep2 String Float c
procRhythmicity232Fneg :: (Float -> c) -> String -> Coeffs2 -> FuncRep2 String Float c
procRhythmicity232Fneg Float -> c
g String
choice Coeffs2
coeffs = (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23Fneg Float -> c
g String
choice String -> Coeffs2 -> String -> Float
rhythmicity Coeffs2
coeffs
{-# INLINE procRhythmicity232Fneg #-}
procBoth2F
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBoth2F :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBoth2F Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2F Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations2 Coeffs2
coeffs
{-# INLINE procBoth2F #-}
procBoth2Fneg
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBoth2Fneg :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBoth2Fneg Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2Fneg Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations2 Coeffs2
coeffs
{-# INLINE procBoth2Fneg #-}
procBoth2InvF
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBoth2InvF :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBoth2InvF Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvF Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations2 Coeffs2
coeffs
{-# INLINE procBoth2InvF #-}
procBoth2InvFneg
:: (Ord c) => (Float -> c)
-> Coeffs2
-> FuncRep2 String Float c
procBoth2InvFneg :: (Float -> c) -> Coeffs2 -> FuncRep2 String Float c
procBoth2InvFneg Float -> c
g Coeffs2
coeffs = (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
forall c.
Ord c =>
(Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvFneg Float -> c
g [[[UZPP2]]] -> [[Float]]
S.syllableDurations2 Coeffs2
coeffs
{-# INLINE procBoth2InvFneg #-}
eval23Coeffs :: Coeffs2 -> [Float] -> Float
eval23Coeffs :: Coeffs2 -> [Float] -> Float
eval23Coeffs (CF2 Maybe Float
x Maybe Float
y) = Float -> Float -> [Float] -> Float
forall a. (RealFrac a, Floating a) => a -> a -> [a] -> a
evalRhythmicity23K (Float -> Maybe Float -> Float
forall a. a -> Maybe a -> a
fromMaybe Float
1.0 Maybe Float
x) (Float -> Maybe Float -> Float
forall a. a -> Maybe a -> a
fromMaybe Float
1.0 Maybe Float
y)
eval23Coeffs Coeffs2
CF0 = [Float] -> Float
forall a. (RealFrac a, Floating a) => [a] -> a
evalRhythmicity23
procRhythm23F
:: (Ord c) => (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23F :: (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23F Float -> c
h String
choice String -> Coeffs2 -> String -> Float
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (String -> Coeffs2 -> String -> Float
g String
choice Coeffs2
coeffs) Float -> c
h
{-# INLINE procRhythm23F #-}
procRhythm23Fneg
:: (Ord c) => (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23Fneg :: (Float -> c)
-> String
-> (String -> Coeffs2 -> String -> Float)
-> Coeffs2
-> FuncRep2 String Float c
procRhythm23Fneg Float -> c
h String
choice String -> Coeffs2 -> String -> Float
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (Float -> Float
forall a. Num a => a -> a
negate (Float -> Float) -> (String -> Float) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Coeffs2 -> String -> Float
g String
choice Coeffs2
coeffs) Float -> c
h
{-# INLINE procRhythm23Fneg #-}
procB2F
:: (Ord c) => (Float -> c)
-> ([[[S.UZPP2]]] -> [[Float]])
-> Coeffs2
-> FuncRep2 String Float c
procB2F :: (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2F Float -> c
h [[[UZPP2]]] -> [[Float]]
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (\String
xs -> let ys :: String
ys = String -> String
convertToProperUkrainianS (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map (\Char
x -> if Char
x Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-' then Char
' ' else Char
x) (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ String
xs in ((Int -> Float
int2Float (Int -> Float) -> (String -> Int) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Int) -> (String -> Int16) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys)Float -> Float -> Float
forall a. Num a => a -> a -> a
*(Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys))) Float -> c
h
{-# INLINE procB2F #-}
procB2Fneg
:: (Ord c) => (Float -> c)
-> ([[[S.UZPP2]]] -> [[Float]])
-> Coeffs2
-> FuncRep2 String Float c
procB2Fneg :: (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2Fneg Float -> c
h [[[UZPP2]]] -> [[Float]]
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (\String
xs -> let ys :: String
ys = String -> String
convertToProperUkrainianS (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map (\Char
x -> if Char
x Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-' then Char
' ' else Char
x) (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ String
xs in ((Int -> Float
int2Float (Int -> Float) -> (String -> Int) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int
forall a. Num a => a -> a
negate (Int -> Int) -> (String -> Int) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Int) -> (String -> Int16) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys)Float -> Float -> Float
forall a. Num a => a -> a -> a
*(Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys))) Float -> c
h
{-# INLINE procB2Fneg #-}
procB2InvF
:: (Ord c) => (Float -> c)
-> ([[[S.UZPP2]]] -> [[Float]])
-> Coeffs2
-> FuncRep2 String Float c
procB2InvF :: (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvF Float -> c
h [[[UZPP2]]] -> [[Float]]
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (\String
xs ->
let !ys :: String
ys = String -> String
convertToProperUkrainianS (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map (\Char
x -> if Char
x Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-' then Char
' ' else Char
x) (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ String
xs
!z :: Int16
z = String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" String
ys in if Int16
z Int16 -> Int16 -> Bool
forall a. Eq a => a -> a -> Bool
== Int16
0 then (([Float] -> Float
forall a. (RealFrac a, Floating a) => [a] -> a
evalRhythmicity23 ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys) Float -> Float -> Float
forall a. Num a => a -> a -> a
* (Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys)) else ((Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys) Float -> Float -> Float
forall a. Fractional a => a -> a -> a
/ (Int -> Float
int2Float (Int -> Float) -> (Int16 -> Int) -> Int16 -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Float) -> Int16 -> Float
forall a b. (a -> b) -> a -> b
$ Int16
z))) Float -> c
h
{-# INLINE procB2InvF #-}
procB2InvFneg
:: (Ord c) => (Float -> c)
-> ([[[S.UZPP2]]] -> [[Float]])
-> Coeffs2
-> FuncRep2 String Float c
procB2InvFneg :: (Float -> c)
-> ([[[UZPP2]]] -> [[Float]]) -> Coeffs2 -> FuncRep2 String Float c
procB2InvFneg Float -> c
h [[[UZPP2]]] -> [[Float]]
g Coeffs2
coeffs = (String -> Float) -> (Float -> c) -> FuncRep2 String Float c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (\String
xs ->
let !ys :: String
ys = String -> String
convertToProperUkrainianS (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map (\Char
x -> if Char
x Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-' then Char
' ' else Char
x) (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ String
xs
!z :: Int16
z = String -> String -> Int16
forall (t :: * -> *). Foldable t => String -> t Char -> Int16
diverse2GL String
" 01-" String
ys in if Int16
z Int16 -> Int16 -> Bool
forall a. Eq a => a -> a -> Bool
== Int16
0 then (Float -> Float
forall a. Num a => a -> a
negate (Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys) Float -> Float -> Float
forall a. Num a => a -> a -> a
* (Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys)) else ((Coeffs2 -> [Float] -> Float
eval23Coeffs Coeffs2
coeffs ([Float] -> Float) -> (String -> [Float]) -> String -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Float]] -> [Float]
forall a. Monoid a => [a] -> a
mconcat ([[Float]] -> [Float])
-> (String -> [[Float]]) -> String -> [Float]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[[UZPP2]]] -> [[Float]]
g ([[[UZPP2]]] -> [[Float]])
-> (String -> [[[UZPP2]]]) -> String -> [[Float]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [[[UZPP2]]]
S.createSyllablesUkrS (String -> Float) -> String -> Float
forall a b. (a -> b) -> a -> b
$ String
ys) Float -> Float -> Float
forall a. Fractional a => a -> a -> a
/ (Int -> Float
int2Float (Int -> Float) -> (Int16 -> Int) -> Int16 -> Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int
forall a. Num a => a -> a
negate (Int -> Int) -> (Int16 -> Int) -> Int16 -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Float) -> Int16 -> Float
forall a b. (a -> b) -> a -> b
$ Int16
z))) Float -> c
h
{-# INLINE procB2InvFneg #-}