Copyright | (c) OleksandrZhabenko 2020-2021 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Extensions | BangPatterns |
This module works with syllable segmentation. The generalized version for the module
Arr
from ukrainian-phonetics-basic-array
package.
Synopsis
- data PRS = SylS {
- charS :: !Char
- phoneType :: !PhoneticType
- data PhoneticType = P !Int8
- type CharPhoneticClassification = [PRS]
- type StringRepresentation = [PRS]
- str2PRSs :: CharPhoneticClassification -> String -> StringRepresentation
- isVowel1 :: PRS -> Bool
- isVwl :: Char -> Bool
- isSonorous1 :: PRS -> Bool
- isVoicedC1 :: PRS -> Bool
- isVoicelessC1 :: PRS -> Bool
- isNotVowel2 :: PRS -> PRS -> Bool
- notEqC :: [(Char, Char)] -> PRS -> PRS -> Bool
- sndGroups :: [PRS] -> [[PRS]]
- groupSnds :: [PRS] -> [[PRS]]
- data SegmentationInfo1 = SI {
- fieldN :: !Int8
- predicateN :: Int8
- data SegmentationPredFunction = PF (SegmentationInfo1 -> [PRS] -> Bool)
- data SegmentationRules1 = SP1 {
- infoS :: SegmentationInfo1
- pF :: [SegmentationPredFunction]
- res :: [([PRS] -> [PRS], [PRS] -> [PRS])]
- type SegmentPredicates = [SegmentationRules1]
- divCnsnts :: [(Char, Char)] -> SegmentPredicates -> [PRS] -> ([PRS] -> [PRS], [PRS] -> [PRS])
- reSyllableCntnts :: [(Char, Char)] -> SegmentPredicates -> [[PRS]] -> [[PRS]]
- divVwls :: [[PRS]] -> [[PRS]]
- createSyllablesPL :: GWritingSystemPRPLX -> [(Char, Char)] -> CharPhoneticClassification -> SegmentPredicates -> String -> String -> String -> [[[PRS]]]
Documentation
SylS | |
|
data PhoneticType Source #
Instances
Eq PhoneticType Source # | |
Defined in Data.Phonetic.Languages.Syllables (==) :: PhoneticType -> PhoneticType -> Bool # (/=) :: PhoneticType -> PhoneticType -> Bool # | |
Ord PhoneticType Source # | |
Defined in Data.Phonetic.Languages.Syllables compare :: PhoneticType -> PhoneticType -> Ordering # (<) :: PhoneticType -> PhoneticType -> Bool # (<=) :: PhoneticType -> PhoneticType -> Bool # (>) :: PhoneticType -> PhoneticType -> Bool # (>=) :: PhoneticType -> PhoneticType -> Bool # max :: PhoneticType -> PhoneticType -> PhoneticType # min :: PhoneticType -> PhoneticType -> PhoneticType # |
type CharPhoneticClassification = [PRS] Source #
The list must be sorted in the ascending order to be used in the module correctly.
type StringRepresentation = [PRS] Source #
isSonorous1 :: PRS -> Bool Source #
Function-predicate isSonorous1
checks whether its argument is a sonorous consonant representation in the PRS
format.
isVoicedC1 :: PRS -> Bool Source #
Function-predicate isVoicedC1
checks whether its argument is a voiced consonant representation in the PRS
format.
isVoicelessC1 :: PRS -> Bool Source #
Function-predicate isVoiceless1
checks whether its argument is a voiceless consonant representation in the PRS
format.
isNotVowel2 :: PRS -> PRS -> Bool Source #
Binary function-predicate isNotVowel2
checks whether its arguments are both consonant representations in the PRS
format.
:: [(Char, Char)] | The pairs of the |
-> PRS | |
-> PRS | |
-> Bool |
Binary function-predicate notEqC
checks whether its arguments are not the same consonant sound representations (not taking palatalization into account).
data SegmentationInfo1 Source #
SI | |
|
Instances
Eq SegmentationInfo1 Source # | |
Defined in Data.Phonetic.Languages.Syllables (==) :: SegmentationInfo1 -> SegmentationInfo1 -> Bool # (/=) :: SegmentationInfo1 -> SegmentationInfo1 -> Bool # |
data SegmentationPredFunction Source #
PF (SegmentationInfo1 -> [PRS] -> Bool) |
data SegmentationRules1 Source #
SP1 | |
|
type SegmentPredicates = [SegmentationRules1] Source #
List of the SegmentationRules1
sorted in the descending order by the fieldN
SegmentationInfo1
data and where the
length of all the SegmentationPredFunction
lists of PRS
are equal to the fieldN
SegmentationInfo1
data by definition.
divCnsnts :: [(Char, Char)] -> SegmentPredicates -> [PRS] -> ([PRS] -> [PRS], [PRS] -> [PRS]) Source #
Function divCnsnts
is used to divide groups of consonants into two-elements lists that later are made belonging to
different neighbour syllables if the group is between two vowels in a word. The group must be not empty, but this is not checked.
The example phonetical information for the proper performance in Ukrainian can be found from the:
https://msn.khnu.km.ua/pluginfile.php/302375/mod_resource/content/1/%D0%9B.3.%D0%86%D0%86.%20%D0%A1%D0%BA%D0%BB%D0%B0%D0%B4.%D0%9D%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D1%81.pdf
The example of the divCnsnts
can be found at: https://hackage.haskell.org/package/ukrainian-phonetics-basic-array-0.1.2.0/docs/src/Languages.Phonetic.Ukrainian.Syllable.Arr.html#divCnsnts
reSyllableCntnts :: [(Char, Char)] -> SegmentPredicates -> [[PRS]] -> [[PRS]] Source #
:: GWritingSystemPRPLX | |
-> [(Char, Char)] | |
-> CharPhoneticClassification | |
-> SegmentPredicates | |
-> String | Corresponds to the '0' symbol delimiter in the |
-> String | Corresponds to the '1' and '-' symbol delimiters in the |
-> String | Actually the converted |
-> [[[PRS]]] |