packages feed

phonetic-languages-constraints-array 0.7.0.1 → 0.7.1.0

raw patch · 3 files changed

+23/−10 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -68,3 +68,11 @@  * Seventh version revised A. Some minor documentation improvements. +## 0.7.1.0 -- 2023-06-01++* Seventh version revised B. Fixed some issues with incorrect False validation for algebraic constraints+handling that lead to no constraints at all for applications and in the oneChange function with +incorrect foldr function definition. Now the algebraic constraints functionality should work better +(hopefully, as expected).++
Phladiprelio/ConstraintsEncoded.hs view
@@ -102,21 +102,21 @@   | y `elem` "-)" || isDigit y = False   | otherwise = validOrdStr0 (y:t:ys) n m  validOrdStr0 xs@(x:y:t:ys) n m -  | x `elem` "ABDFHIMNPQRTVW" = if isDigit y then validOrdStr0 (dropWhile isDigit (t:ys)) n m else False+  | x `elem` "ABDFHIMNPQRTVW" && isDigit y = validOrdStr0 (dropWhile isDigit (t:ys)) n m +  | x `elem` "ABDFHIMNPQRTVW" = False   | otherwise = validOrdStr0 (y:t:ys) n (m + 1)  validOrdStr0 xs@(x:')':ys) n m -  | isDigit x || x == ')' = validOrdStr0 ys n (if x == ')' then m + 2 else m + 1) +  | isDigit x = validOrdStr0 ys n (m + 1)+  | x == ')' = validOrdStr0 ys n (m + 2)    | otherwise = False validOrdStr0 xs@(x:y:ys) n m    | x `elem` "(ABDFHIMNQRTVW" = False   | y `elem` " -(ABDFHIMNPQRTVW" = False   | x == 'P' && not (isDigit y) = False-  | x == ')' && y `notElem` ")E" = False+  | x == ')' && y /= 'E' = False   | x == 'P' && n == m = True-  | x == ')' && y == ')' = n == (m + 2)   | x == ')' && y == 'E' = n == (m + 1)   | (x `elem` "E -") && y == 'E' = n == m -  | x == 'E' && y == ')' = n == (m + 1)   | otherwise = False validOrdStr0 xs@(x:ys) n m    | isDigit x || (x `elem` ")E") = if x == ')' then n == (m + 1) else n == m @@ -187,20 +187,25 @@ noParenString = or . map noParenString0 . splitNoParenAtDisjunction {-# INLINE noParenString #-} +oneStep :: Int -> Array Int Int -> [String] -> Bool+oneStep m arr = noParenString . words . convertToBools m arr+{-# INLINE oneStep #-}+ oneChange :: Int -> Array Int Int -> [String] -> [String] oneChange m arr xss -  | null wss = [show . noParenString . words . convertToBools m arr $ xss]-  | otherwise = ((\(jss, m, qss) -> jss `mappend` [show . noParenString . words . convertToBools m arr $ qss]) . +  | null wss = [show . oneStep m arr $ xss]+  | otherwise = ((\(jss, m, qss) -> jss `mappend` [show . oneStep m arr $ qss]) .                    foldr (\xs uss@(tss, n, rss) -> if xs == "(" && n == 0                                                        then (tss, 1, rss)                                                        else if any (== '(') xs && n == 0-                                                               then (drop 1 xs:tss, n, rss)+                                                               then (drop 1 xs:tss, 1, rss)                                                                else case n of                                                                        0 -> (tss, 0, xs:rss)                                                                       1 -> (xs:tss, 1, rss)) ([], 0, []) $ yss) `mappend` kss   where (yss,wss) = break (any (== ')')) xss         kss = case wss of-                ws:vss -> if length ws == 1 then vss else drop 1 ws : vss+                ")":vss -> vss +                ws:vss -> drop 1 ws : vss                 _      -> wss  generalConversion :: Int -> String -> Array Int Int -> Bool
phonetic-languages-constraints-array.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/  name:                phonetic-languages-constraints-array-version:             0.7.0.1+version:             0.7.1.0 synopsis:            Constraints to filter the needed permutations description:         Provides several the most important variants of constraints. Can be used with the phonetic-languages-common series of package. Instead of vectors, uses arrays. homepage:            https://hackage.haskell.org/package/phonetic-languages-constraints-array