-- |
-- Module : Phonetic.Languages.Simplified.Lists.Ukrainian.FuncRep2RelatedG
-- Copyright : (c) OleksandrZhabenko 2020
-- License : MIT
-- Stability : Experimental
-- Maintainer : olexandr543@yahoo.com
--
-- Functions to choose from the 'FuncRep' variants.
{-# LANGUAGE BangPatterns #-}
module Phonetic.Languages.Simplified.Lists.Ukrainian.FuncRep2RelatedG where
import CaseBi (getBFst')
import qualified Data.Vector as VB
import Phonetic.Languages.Simplified.DataG
import Phonetic.Languages.Lists.Ukrainian.PropertiesFuncRepG
import Phonetic.Languages.Lists.Ukrainian.PropertiesSyllablesG
-- | Allows to choose the variant of the computations in case of usual processment.
chooseMax :: (Ord c) => (Float -> c) -> Coeffs2 -> String -> FuncRep2 String Float c
chooseMax g coeffs choice
| isPair coeffs = getBFst' (procBoth2InvF g coeffs, VB.fromList [("02y",procRhythmicity232F g "02y" coeffs), ("0y",procRhythmicity23F g "0y" coeffs),
("y",procBothF g coeffs),("y0",procDiverse2F g),("y2",procBoth2F g coeffs),("yy",procBothInvF g coeffs)]) choice
| otherwise = getBFst' (procBoth2InvF g coeffs, VB.fromList [("02y",procRhythmicity232F g "02y" coeffs),("0y",procRhythmicity23F g "0y" coeffs),
("y",procBothF g coeffs),("y0",procDiverse2F g),("y2",procBoth2F g coeffs),("yy",procBothInvF g coeffs)]) choice
-- | Allows to choose precision in the Numeric.showFFloat function being given a choice parameter.
precChoice :: String -> Maybe Int
precChoice = getBFst' (Just 4, VB.fromList [("02y",Just 0),("0y",Just 0),("y",Just 0),("y0",Just 0),("y2",Just 0)])