packages feed

phonetic-languages-simplified-examples-array-0.1.0.0: Phonetic/Languages/Simplified/Array/Ukrainian/FuncRep2RelatedG2.hs

-- |
-- Module      :  Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2
-- Copyright   :  (c) OleksandrZhabenko 2020
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  olexandr543@yahoo.com
--
-- Functions to choose from the 'FuncRep2' variants.

{-# LANGUAGE BangPatterns #-}

module Phonetic.Languages.Simplified.Array.Ukrainian.FuncRep2RelatedG2 where

import CaseBi.Arr (getBFstL')
import Phonetic.Languages.Simplified.DataG.Base
import Phonetic.Languages.Array.Ukrainian.PropertiesFuncRepG2
import Phonetic.Languages.Array.Ukrainian.PropertiesSyllablesG2

-- | Allows to choose the variant of the computations in case of usual processment.
chooseMax :: (Ord c) => (Double -> c) -> Coeffs2 -> String -> FuncRep2 String Double c
chooseMax g coeffs choice
 | isPair coeffs = getBFstL' (procBoth3InvF g coeffs) [("02y",procRhythmicity23F g "02y" coeffs),
    ("03y",procRhythmicity23F g "03y" coeffs), ("0y",procRhythmicity23F g "0y" coeffs),
     ("y",procBothF g coeffs),("y0",procDiverse2F g),("y2",procBoth2F g coeffs),("y3",procBoth3F g coeffs),
       ("yy",procBothInvF g coeffs),("yy2",procBoth2InvF g coeffs)] choice
 | otherwise = getBFstL' (procBoth3InvF g coeffs) [("02y",procRhythmicity23F g "02y" coeffs),
    ("03y",procRhythmicity23F g "03y" coeffs),("0y",procRhythmicity23F g "0y" coeffs),
     ("y",procBothF g coeffs),("y0",procDiverse2F g),("y2",procBoth2F g coeffs),("y3",procBoth3F g coeffs),
       ("yy",procBothInvF g coeffs),("yy2",procBoth2InvF g coeffs)] choice

-- | Allows to choose precision in the Numeric.showFDouble function being given a choice parameter.
precChoice :: String -> Maybe Int
precChoice = getBFstL' (Just 4) [("02y",Just 0),("03y",Just 0),("0y",Just 0),("y",Just 0),("y0",Just 0),("y2",Just 0),("y3",Just 0)]