packages feed

ukrainian-phonetics-basic 0.1.6.0 → 0.1.7.0

raw patch · 3 files changed

+29/−20 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -27,3 +27,7 @@ ## 0.1.6.0 -- 2020-10-28  * First version revised F. Fixed some issues with palatalization and some combinations that were not properly handled. ++## 0.1.7.0 -- 2020-10-28++* First version revised G. Fixed some issues with empty ByteString in the Melodics.ByteString.Ukrainian module.
Melodics/ByteString/Ukrainian.hs view
@@ -142,7 +142,12 @@ {-# INLINE canChange #-}  bsToCharUkr :: [(B.ByteString,Triple)] -> [(Char,Triple)]-bsToCharUkr = map (\(xs,y) -> (X.getBFst' (B.head xs, VB.fromList . zip ["cq","dB","dz","nt","sq","st","tq","ts","xh"] $ "wjANDOPch") xs,y))+bsToCharUkr zs+ | null zs = []+ | otherwise = map g zs+     where g (ts,k)+             | B.null ts = ('0',Z)+             | otherwise = (X.getBFst' (B.head ts, VB.fromList . zip ["cq","dB","dz","nt","sq","st","tq","ts","xh"] $ "wjANDOPch") ts,k)   applyChanges :: [(Char, Triple)] -> [(Char, Triple)]@@ -157,8 +162,8 @@              zs = tail xs  -isVoicedObstruent :: Char -> Bool-isVoicedObstruent = getBFst' (False, V.fromList $ zip "ABbdghjz" (repeat True))+isVoicedObstruent :: B.ByteString -> Bool+isVoicedObstruent = X.getBFst' (False, VB.fromList [("A",True),("B",True),("b",True),("d",True),("g",True),("h",True),("j",True),("z", True)]) . B.take 1  isSoftDOrL :: [(Char, Triple)] -> Bool isSoftDOrL = X.getBFst' (False, VB.fromList . zip ["bq","cq","dq","fq","lq","mq","nq","pq","sq","tq","vq"] $ (repeat True)) . takeFromFT_ 2@@ -202,7 +207,7 @@ зT _ = ('z', Z)  кT :: [(Char, Triple)] -> (Char, Triple)-кT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('g', Z)+кT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('g', Z)             | otherwise = ('k', Z) кT _ = ('k', Z) @@ -213,20 +218,20 @@ нтT _ = ('N', T)  пT :: [(Char, Triple)] -> (Char, Triple)-пT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('b', Z)+пT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('b', Z)             | otherwise = ('p', Z) пT _ = ('p', Z)  сT :: [(Char, Triple)] -> (Char, Triple)-сT t1@(_:_) | ((isVoicedObstruent . B.head . takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q") = ('R', T)-            | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('b', Z)+сT t1@(_:_) | ((isVoicedObstruent .  takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q") = ('R', T)+            | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('b', Z)             | isSoftDOrL t1 = ('D', Z)             | takeFromFT_ 1 t1 == "F" = ('F', Z)             | otherwise = ('s', Z) сT _ = ('s', Z)  стT :: [(Char, Triple)] -> (Char, Triple)-стT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1  = ('z', Z)+стT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1  = ('z', Z)              | takeFromFT_ 3 t1 == "sqk" || (takeFromFT_ 2 t1 `elem` ["Dk","cq"]) || takeFromFT_ 1 t1 == "w" = ('D', Z)              | takeFromFT_ 1 t1 `elem` ["s","n"] = ('s', Z)              | takeFromFT_ 1 t1 == "E" = ('F', Z)@@ -234,13 +239,13 @@ стT _ = ('O', T)  сьT :: [(Char, Triple)] -> (Char, Triple)-сьT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('R', T)+сьT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('R', T)              | otherwise = ('D', Z) сьT _ = ('D', Z)  тT :: [(Char, Triple)] -> (Char, Triple)-тT t1@(_:_) | (isVoicedObstruent . B.head . takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('T', T)-            | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('d', Z)+тT t1@(_:_) | (isVoicedObstruent .  takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('T', T)+            | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('d', Z)             | takeFromFT_ 2 t1 == "cq" || takeFromFT_ 1 t1 == "w"  = ('w', Z)             | takeFromFT_ 1 t1 == "c" = ('c', Z)             | isSoftDen t1 = ('P', T)@@ -249,42 +254,42 @@ тT _ = ('t', Z)  тьT :: [(Char, Triple)] -> (Char, Triple)-тьT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('T', T)+тьT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('T', T)              | takeFromFT_ 3 t1 == "sqa" || takeFromFT_ 2 t1 == "Da" = ('w', Z)              | otherwise = ('P', T) тьT _ = ('P', T)  фT :: [(Char, Triple)] -> (Char, Triple)-фT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('v', Z)+фT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('v', Z)             | otherwise = ('f', Z) фT _ = ('f', Z)  хT :: [(Char, Triple)] -> (Char, Triple)-хT t1@(_:_) | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('h', Z)+хT t1@(_:_) | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('h', Z)             | otherwise = ('x', Z) хT _ = ('х', Z)  цT :: [(Char, Triple)] -> (Char, Triple)-цT t1@(_:_) | (isVoicedObstruent . B.head . takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('Q', T)+цT t1@(_:_) | (isVoicedObstruent .  takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('Q', T)             | isSoftDOrL t1 = ('w', Z)-            | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('A', Z)+            | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('A', Z)             | otherwise = ('c', Z) цT _ = ('c', Z)  цьT :: [(Char, Triple)] -> (Char, Triple)-цьT t1@(_:_) | (isVoicedObstruent . B.head . takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('Q', T)+цьT t1@(_:_) | (isVoicedObstruent .  takeFromFT_ 1 $ t1) && B.drop 1 (takeFromFT_ 2 t1) == "q" = ('Q', T)              | otherwise = ('w', Z) цьT _ = ('w', Z)  чT :: [(Char, Triple)] -> (Char, Triple) чT t1@(_:_) | takeFromFT_ 2 t1 `elem` ["sq","cq"] || takeFromFT_ 1 t1 `elem` ["D","w"] = ('w', Z)-            | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('j', Z)+            | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('j', Z)             | otherwise = ('E', Z) чT _ = ('E', Z)  шT :: [(Char, Triple)] -> (Char, Triple) шT t1@(_:_) | takeFromFT_ 2 t1 `elem` ["sq","cq"] || takeFromFT_ 1 t1 `elem` ["D","w"] = ('D', Z)-            | isVoicedObstruent . B.head . takeFromFT_ 1 $ t1 = ('B', Z)+            | isVoicedObstruent .  takeFromFT_ 1 $ t1 = ('B', Z)             | otherwise = ('F', Z) шT _ = ('F', Z) 
ukrainian-phonetics-basic.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/  name:                ukrainian-phonetics-basic-version:             0.1.6.0+version:             0.1.7.0 synopsis:            A library to work with the basic Ukrainian phonetics and syllable segmentation. description:         A library to work with the basic Ukrainian phonetics and syllable segmentation. Rewritten from the mmsyn6ukr and mmsyn7s packages. homepage:            https://hackage.haskell.org/package/ukrainian-phonetics-basic