0.5.2 • Published 2 years ago

silabacion v0.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Silabación

Separate Spanish words into syllables.

build-test codecov

Installation

As with any other NPM package, you can install it with npm or yarn.

Usage

import { Word, Stress } from 'silabacion';

const word = new Word('hispanófilo');
console.log(word.word); // hispanófilo
console.log(word.length); // 11
console.log(word.syllables.length); // 5
console.log(word.syllables[0]); // { onset: 'h', nucleus: 'i', coda: 's' }
console.log(Stress[word.stress]); // Proparoxytone
console.log(word.rhyme); // ófilo
console.log(word.tonic); // { onset: 'f', nucleus: 'i', coda: '' }

const word = new Word('aéreo');
console.log(word.hiatuses);
// [
//   { syllableIndex: 0, composite: 'aé', type: 1 },
//   { syllableIndex: 2, composite: 'eo', type: 0 }
// ]
console.log(word.diphthongs);
// []
console.log(word.triphthongs);
// []

// Note: diphthongs and hiatuses have a enum type attribute
export enum HiatusType {
  Simple,
  Acentual,
}

export enum DiphthongType {
  Creciente,
  Decreciente,
  Homogéneo,
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Compare

  • silabas.js only separates syllables. GNU licensed.
  • silabajs functionally comparable. It's in pure js instead of typescript.
0.5.2

2 years ago

0.5.0

3 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.1.0

4 years ago