A repo for storing helper functions needed to process the Ukrainian language in various ways
Install the package via npm
npm i @ukie-app/uk-lang-helpers --save-dev
Import the specific function into your project
const { splitTheWordIntoSyllables } = require('@ukie-app/uk-lang-helpers')
if you want to clone GitHub repo and test it locally you can run
npm run test
to run tests specified in the tests/testObj.js
file
This function splits the word into syllables
Syllable forming rules:
Based on rules specified in EdEra book
Main rule: vowels form syllables
- There are as many syllables as there are vowels
- A syllable cannot exist without a vowel
Cases to form a new syllable with the current consonant:
- both neighbors are vowels (
г
inкни-га
) - it's sonorant and its previous neighbor is sonorant as well (
н
inвiль-но
,н
inвiр-нiсть
) - it's voiced and its previous neighbor is voiceless (
т
inгреб-ти
,к
inнiж-ка
) - the next consonant neighbor is the same type (voiced or voiceless) (
с
inго-спо-дар
,ща-стя
) - it's voiced or voiceless consonant and its next neighbor is sonorant (
з
inбли-зня-та
,д
inму-дрець
) - its next neighbor is the same letter (doubling of consonants) (
збi-жжя
,бу-ття
,во-ло-сся
)
This package follows npm's semantic versioning guildelines