phonetic-languages-simplified-common 0.3.3.0 → 0.3.4.0
raw patch · 3 files changed
+24/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Phonetic.Languages.Simplified.DataG: innerPartitioningR :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c) => t2 (Result t a b c) -> (t2 (Result t a b c), t2 (Result t a b c))
+ Phonetic.Languages.Simplified.DataG: maximumGroupsClassificationR2 :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d -> (t2 (Result t a b c), t2 (Result t a b c)) -> (t2 (Result t a b c), t2 (Result t a b c))
Files
- CHANGELOG.md +3/−0
- Phonetic/Languages/Simplified/DataG.hs +20/−4
- phonetic-languages-simplified-common.cabal +1/−1
CHANGELOG.md view
@@ -31,3 +31,6 @@ * Third version revised C. Fixed issue with group classification for empty data. +## 0.3.4.0 -- 2020-11-28++* Third version revised D. Added new functions to the module Phonetic.Languages.Simplified.DataG. Fixed issues with group classification for empty data.
Phonetic/Languages/Simplified/DataG.hs view
@@ -70,6 +70,7 @@ ----------------------------------------------------------------------------------- +-- | The second argument must be not empty for the function to work correctly. innerPartitioning :: (InsertLeft t2 (t a), Monoid (t2 (t a)), InsertLeft t2 c, Monoid (t2 c), Ord c) => FuncRep2 (t a) b c -> t2 (t a)@@ -77,6 +78,13 @@ innerPartitioning !frep2 data0 = let !l = F.maximum . mapG (toTransMetrices' frep2) $ data0 in partitionG ((== l) . getAC frep2) data0 +-- | The second argument must be not empty for the function to work correctly.+innerPartitioningR+ :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c) => t2 (Result t a b c)+ -> (t2 (Result t a b c), t2 (Result t a b c))+innerPartitioningR dataR =+ let !l = F.maximum . mapG transMetrices $ dataR in partitionG ((== l) . transMetrices) dataR+ maximumGroupsClassification :: (InsertLeft t2 (t a), Monoid (t2 (t a)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d -> FuncRep2 (t a) b c@@ -98,16 +106,24 @@ | nGroups <= 0 = innerPartitioning frep2 data0 | otherwise = maximumGroupsClassification (nGroups - 1) frep2 . innerPartitioning frep2 $ data0 +maximumGroupsClassificationR2+ :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), Ord c, InsertLeft t2 c, Monoid (t2 c), Integral d) => d+ -> (t2 (Result t a b c), t2 (Result t a b c))+ -> (t2 (Result t a b c), t2 (Result t a b c))+maximumGroupsClassificationR2 !nGroups (dataT,dataF)+ | F.null dataF = (dataT,mempty)+ | nGroups <= 0 = (dataT,dataF)+ | otherwise = maximumGroupsClassificationR2 (nGroups - 1) (dataT `mappend` partT,partF)+ where (!partT,!partF) = innerPartitioningR dataF+ maximumGroupsClassificationR :: (InsertLeft t2 (Result t a b c), Monoid (t2 (Result t a b c)), InsertLeft t2 c, Monoid (t2 c), Ord c, Integral d) => d -> t2 (Result t a b c) -> (t2 (Result t a b c), t2 (Result t a b c)) maximumGroupsClassificationR !nGroups dataR | F.null dataR = (mempty,mempty)- | nGroups <= 1 = (partT,partF)- | otherwise = (partT `mappend` (fst . maximumGroupsClassificationR (nGroups - 1) $ partF),snd . maximumGroupsClassificationR (nGroups - 1) $ partF)- where !maxE0 = F.maximum . mapG transMetrices $ dataR- (!partT,!partF) = partitionG ((== maxE0) . transMetrices) dataR+ | nGroups <= 0 = innerPartitioningR dataR+ | otherwise = maximumGroupsClassificationR2 (nGroups - 1) . innerPartitioningR $ dataR toResultR :: FuncRep2 (t a) b c
phonetic-languages-simplified-common.cabal view
@@ -3,7 +3,7 @@ -- http://haskell.org/cabal/users-guide/ name: phonetic-languages-simplified-common-version: 0.3.3.0+version: 0.3.4.0 synopsis: A simplified version of the phonetic-languages-functionality description: A simplified version of the phonetic-languages-functionality. Tries to use only necessary functionality and reduce the other one. homepage: https://hackage.haskell.org/package/phonetic-languages-simlified-common