Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
README.md
index.js
package-lock.json
package.json

README.md

stress-pt

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.

Install

npm i -S stress-pt
const {syllable, stressed, wordStressed} = require('stress-pt');

Try it in your browser

API

syllable

Returns a word with syllables separated by '|'.

syllable('batatas'); // 'ba|ta|tas'

wordStressed

Returns a word with syllables separated by '|' and the stressed vowel marked with ':'.

wordStressed('batatas'); // 'ba|ta:|tas'

stressed

Returns multi word text with all the words with syllables separated and stressed vowel marked.

stressed('Olá mundo!'); // 'O|lá: mu:n|do!'

To do

  • port other functions as well (toPhon, ...)
  • add support for other languages

Bugs and stuff

Open a GitHub issue or, preferably, send me a pull request.

Acknowledgements

Many thanks to José João Almeida and Alberto Simões, who developed the original version of this code in Perl: Lingua::PT::PLN.

License

The MIT License (MIT)

Copyright (c) 2019 André Santos andrefs@andrefs.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.

You can’t perform that action at this time.