Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Maintainer : olexandr543@yahoo.com
A program and a library that show a sorted list of the Ukrainian sounds representations that can be used by mmsyn7 series of programs. This module works with syllable segmentation.
Synopsis
- data UZP
- syllablesUkr :: String -> [[String]]
- takeWordS :: Int -> String -> [[String]]
- sylLengths :: [[String]] -> [[Int]]
- syllablesUkrP :: String -> [[[UZP]]]
- takeWordSP :: Int -> String -> [[[UZP]]]
- sylLengthsP :: [[[UZP]]] -> [[Int]]
- sylLengthsP2 :: [[[UZP]]] -> [[Int]]
- createSyllables :: [[UZP]] -> [String]
- divideConsonants :: [UZP] -> [[UZP]]
- groupConsonants :: [[UZP]] -> [[UZP]]
- sndGroups :: [UZP] -> [[UZP]]
- takeWithV :: [[UZP]] -> [String]
- vecToUZPs :: Vector String -> [UZP]
- vecWords :: Vector String -> [Vector String]
- uzpsToList :: [[UZP]] -> [String]
- representProlonged :: [UZP] -> [UZP]
- filterC :: (Char -> Bool) -> UZP -> String
- createSyllablesP :: [[UZP]] -> [[UZP]]
- takeWithVP :: [[UZP]] -> [[UZP]]
- isNotVowel2 :: UZP -> UZP -> Bool
- isSonorous1 :: UZP -> Bool
- isVoicedC1 :: UZP -> Bool
- isVoicelessC1 :: UZP -> Bool
- isVowel1 :: UZP -> Bool
- isVwl :: Char -> Bool
- notEqC :: UZP -> UZP -> Bool
Datatype for the Ukrainian sounds representations
Datatype UZP
is a simple sound classification type. Its peculiarity is that it is shown as a usual String (by design corresponding to the Ukrainian sound).
Vowel String | |
Sonorous String | |
SonorousP String | |
Voiced String | |
VoicedP String | |
Voiceless String | |
VoicelessP String | |
VoicelessP2 String |
The resulting functions
syllablesUkr :: String -> [[String]] Source #
Function syllablesUkr
actually converts a String
to the list of words being segmented into the syllables in the String
format. If the Ukrainian word
being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
takeWordS :: Int -> String -> [[String]] Source #
Function takeWordS
takes a number (which is its first argument) of the Ukrainian words and represents them as a list of list of String
, each of which is a syllable
in the String
format.
If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
sylLengths :: [[String]] -> [[Int]] Source #
Function sylLengths
shows number of Ukrainian letters (except ь
) in the syllables in the text needed to represent a sounding of the text,
which was previously converted with syllablesUkr
function. If the syllable does not contain either sounds "дж" / "дз" or prolonged sounds then this number
is also a number of sounds in it.
If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
Working more with UZP format
syllablesUkrP :: String -> [[[UZP]]] Source #
Function syllablesUkrP
actually converts a String
to the list of words being segmented into the syllables in the UZP
format. If the Ukrainian word being written down contains
an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words. This does not influence the syllable structure
and so the poetic characteristics of the text.
takeWordSP :: Int -> String -> [[[UZP]]] Source #
Function takeWordSP
takes a number (which is its first argument) of the Ukrainian words and represents them as a list of list of list of UZP
, each list of UZP
is a syllable.
If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
sylLengthsP :: [[[UZP]]] -> [[Int]] Source #
Function sylLengthsP
shows number of UZP
in the syllables in the text,
which was previously converted with syllablesUkrP
function. If the syllable does not contain prolonged sounds then this number
is also a number of sounds in it.
If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
sylLengthsP2 :: [[[UZP]]] -> [[Int]] Source #
Function sylLengthsP2
shows number of sounds in the syllables in the text,
which was previously converted with syllablesUkrP
function.
If the Ukrainian word being written down contains an apostrophe or a dash (hyphen) signs (or even both) then they are treated as separators for the distinguished words.
This does not influence the syllable structure and so the poetic characteristics of the text.
Used internally
createSyllables :: [[UZP]] -> [String] Source #
Function createSyllables
takes a prepared Ukrainian word and joins the parts (each one being a list of UZP
) so that they constitute syllables in the String
format.
divideConsonants :: [UZP] -> [[UZP]] Source #
Function divideConsonants
is used to divide groups of Ukrainian 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 phonetical information for the proper performance is taken 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
groupConsonants :: [[UZP]] -> [[UZP]] Source #
Function groupConsonants
is used to apply divideConsonants
to the needed groups of consonants.
takeWithV :: [[UZP]] -> [String] Source #
Function takeWithV
is used internally in the createSyllables
.
uzpsToList :: [[UZP]] -> [String] Source #
Function uzpsToList
converts a Ukrainian word being a list of syllables in UZP
format to a list of String
.
representProlonged :: [UZP] -> [UZP] Source #
Function representProlonged
is used internally in the sylLengthsP2
function. It converts duplicated consequent in the syllable consonants
so that they are represented by just one UZP
. After applying the function to the list of UZP
being a syllable all groups of duplicated consequent consonants
in every syllable are represented with only one UZP
respectively.
filterC :: (Char -> Bool) -> UZP -> String Source #
Auxiliary function used internally in the notEqC
function.
Working more with UZP format
createSyllablesP :: [[UZP]] -> [[UZP]] Source #
Function createSyllablesP
takes a prepared Ukrainian word and joins the parts (each one being a list of UZP
) so that they constitute syllables in the UZP
format.
takeWithVP :: [[UZP]] -> [[UZP]] Source #
Function takeWithVP
is used internally in the createSyllablesP
.
Auxiliary predicate functions
isNotVowel2 :: UZP -> UZP -> Bool Source #
Binary function-predicate isNotVowel2
checks whether its arguments are both consonant representations in the UZP
format.
isSonorous1 :: UZP -> Bool Source #
Function-predicate isSonorous1
checks whether its argument is a sonorous consonant representation in the UZP
format.
isVoicedC1 :: UZP -> Bool Source #
Function-predicate isVoicedC1
checks whether its argument is a voiced consonant representation in the UZP
format.
isVoicelessC1 :: UZP -> Bool Source #
Function-predicate isVoiceless1
checks whether its argument is a voiceless consonant representation in the UZP
format.