Functions to split syllables and find stressed vowels in Portuguese text.
Mostly an incomplete port to Node.js of the Perl module Lingua::PT::PLN.
npm i -S stress-pt
const syllable stressed wordStressed = ;
Returns a word with syllables separated by '|'.
; // 'ba|ta|tas'
Returns a word with syllables separated by '|' and the stressed vowel marked with ':'.
; // 'ba|ta:|tas'
Returns multi word text with all the words with syllables separated and stressed vowel marked.
; // 'O|lá: mu:n|do!'
- port other functions as well (
- add support for other languages
Bugs and stuff
Open a GitHub issue or, preferably, send me a pull request.
Many thanks to José João Almeida and Alberto Simões, who developed the original version of this code in Perl: Lingua::PT::PLN.
The MIT License (MIT)
Copyright (c) 2019 André Santos email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.