ukrainian-phonetics-basic 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+14/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Languages.Phonetic.Ukrainian.Syllable: divVwls :: [[UZPP2]] -> [[UZPP2]]
Files
- CHANGELOG.md +5/−0
- Languages/Phonetic/Ukrainian/Syllable.hs +8/−2
- ukrainian-phonetics-basic.cabal +1/−1
CHANGELOG.md view
@@ -3,3 +3,8 @@ ## 0.1.0.0 -- 2020-10-21 * First version. Released on an unsuspecting world.++## 0.1.1.0 -- 2020-10-22++* First version revised A. Fixed issue with existence of multi-vowel syllables in the module Languages.Phonetic.Ukrainian.Syllable.+.
Languages/Phonetic/Ukrainian/Syllable.hs view
@@ -22,6 +22,7 @@ import Melodics.ByteString.Ukrainian (convertToProperUkrainian) import CaseBi.Unboxed (getBFst') import qualified CaseBi as X (getBFst')+import Data.List.InnToOut.Basic (mapI) -- Inspired by: https://github.com/OleksandrZhabenko/mm1/releases/tag/0.2.0.0 @@ -162,11 +163,16 @@ reSyllableCntnts (xs:ys:_) = [(xs `mappend` ys)] reSyllableCntnts xss = xss +divVwls :: [[UZPP2]] -> [[UZPP2]]+divVwls = mapI (\ws -> (length . filter ((== W) . phoneType) $ ws) > 1) h3+ where h3 us = [ys `mappend` take 1 zs] `mappend` (L.groupBy (\x y -> phoneType x == W && phoneType y /= W) . drop 1 $ zs)+ where (ys,zs) = span (\t -> phoneType t /= W) us+ createSyllablesUkr :: String -> [[[UZPP2]]]-createSyllablesUkr = map (reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x)+createSyllablesUkr = map (divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x) createSyllablesUkrP :: String -> [[[UZPP2]]]-createSyllablesUkrP = map (map representProlonged . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x)+createSyllablesUkrP = map (map representProlonged . divVwls . reSyllableCntnts . groupSnds . vec2UZPP2s) . vecWords . V.filter (/='0') . convertToProperUkrainian . map (\x -> if x == '-' then ' ' else x) -- | Function 'representProlonged' converts duplicated consequent in the syllable consonants -- so that they are represented by just one 'UZPP2'. After applying the function to the list of 'UZPP2' being a syllable all groups of duplicated consequent consonants
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.0.0+version: 0.1.1.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