ukrainian-phonetics-basic 0.2.0.2 → 0.3.0.0
raw patch · 3 files changed
+29/−2 lines, 3 filesdep +subGPVP ok
version bump matches the API change (PVP)
Dependencies added: subG
API changes (from Hackage documentation)
+ Languages.Phonetic.Ukrainian.Syllable: createSyllablesUkrS :: String -> [[[UZPP2]]]
+ Languages.Phonetic.Ukrainian.Syllable: str2UZPP2s :: String -> [UZPP2]
Files
- CHANGELOG.md +6/−0
- Languages/Phonetic/Ukrainian/Syllable.hs +21/−0
- ukrainian-phonetics-basic.cabal +2/−2
CHANGELOG.md view
@@ -63,3 +63,9 @@ ## 0.2.0.2 -- 2020-11-10 * Second version revised B. Fixed issue with inexact documentation.++## 0.3.0.0 -- 2020-11-25++* Third version. Added new functions to support not only vector-based computations in the Languages.Phonetics.Ukrainian.Syllable module, but also the list-based ones. Added a +new dependency of subG package.+
Languages/Phonetic/Ukrainian/Syllable.hs view
@@ -23,6 +23,7 @@ import CaseBi.Unboxed (getBFst') import qualified CaseBi as X (getBFst') import Data.List.InnToOut.Basic (mapI)+import Data.SubG (subG) -- Inspired by: https://github.com/OleksandrZhabenko/mm1/releases/tag/0.2.0.0 @@ -74,6 +75,22 @@ UZ (V.unsafeHead v) K:vec2UZPP2s (V.unsafeDrop 2 v) | otherwise = UZ (V.unsafeHead v) M:vec2UZPP2s (V.unsafeDrop 2 v) +str2UZPP2s :: String -> [UZPP2]+str2UZPP2s (y:ys)+ | getBFst' (False, V.fromList [('a',True),('e',True),('i',True),('o',True),('u',True),('y',True)]) y = UZ y W:str2UZPP2s ys+ | y == 'D' || y == 'w' = UZ y N:str2UZPP2s ys+ | (null ys || head ys /= 'q') && getBFst' (False, V.fromList [('C',True),('l',True),('m',True),('n',True),('r',True),('v',True)]) y =+ UZ y S:str2UZPP2s ys+ | (null ys || head ys /= 'q') &&+ getBFst' (False, V.fromList [('A',True),('B',True),('b',True),('d',True),('g',True),('h',True),('j',True),('z',True)]) y =+ UZ y D:str2UZPP2s ys+ | (null ys || head ys /= 'q') = UZ y L:str2UZPP2s ys+ | getBFst' (False, V.fromList [('l',True),('m',True),('n',True),('r',True),('v',True)]) y = UZ y O:str2UZPP2s (drop 1 ys)+ | getBFst' (False, V.fromList [('A',True),('B',True),('b',True),('d',True),('g',True),('h',True),('j',True),('z',True)]) y =+ UZ y K:str2UZPP2s (drop 1 ys)+ | otherwise = UZ y M:str2UZPP2s (drop 1 ys)+str2UZPP2s _ = []+ -- | Function-predicate 'isVowel1' checks whether its argument is a vowel representation in the 'UZPP2' format. isVowel1 :: UZPP2 -> Bool isVowel1 = (== W) . phoneType@@ -171,6 +188,10 @@ createSyllablesUkr :: String -> [[[UZPP2]]] createSyllablesUkr = map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x) {-# INLINE createSyllablesUkr #-}++createSyllablesUkrS :: String -> [[[UZPP2]]]+createSyllablesUkrS = map (divVwls . reSyllableCntnts . groupSnds . str2UZPP2s) . subG " 1-" . filter (/='0') . convertToProperUkrainianS . map (\x -> if x == '-' then ' ' else x)+{-# INLINE createSyllablesUkrS #-} createSyllablesUkrP :: String -> [[[UZPP2]]] createSyllablesUkrP = map (map representProlonged . divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x)
ukrainian-phonetics-basic.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: ukrainian-phonetics-basic-version: 0.2.0.2+version: 0.3.0.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@@ -20,6 +20,6 @@ exposed-modules: Languages.Phonetic.Ukrainian.Syllable, Melodics.ByteString.Ukrainian -- other-modules: other-extensions: DeriveDataTypeable, FlexibleInstances, OverloadedStrings- build-depends: base >=4.7 && <4.15, vector >=0.11 && <0.14, mmsyn2 >=0.3 && <1, bytestring >=0.10 && <0.13, mmsyn5 >=0.5 && <1+ build-depends: base >=4.7 && <4.15, vector >=0.11 && <0.14, mmsyn2 >=0.3 && <1, bytestring >=0.10 && <0.13, mmsyn5 >=0.5 && <1, subG >=0.4.2 && <1 -- hs-source-dirs: default-language: Haskell2010