# compromise-syllables

> plugin for nlp-compromise

Latest version **0.0.6** (published 2021-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install compromise-syllables
pnpm add compromise-syllables
yarn add compromise-syllables
bun add compromise-syllables
```

## Health

**Score 50/100 (C)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2021-02-26 |
| First published | 2019-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 40.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12159 |
| Author | Spencer Kelly |
| Maintainers | spencermountain |

## Links

- npm: https://www.npmjs.com/package/compromise-syllables
- Repository: https://github.com/spencermountain/compromise
- Homepage: https://github.com/spencermountain/compromise#readme
- Issues: https://github.com/spencermountain/compromise/issues
- npm.io page: https://npm.io/package/compromise-syllables

## Recent versions

- 0.0.6 (latest) — 2021-02-26
- 0.0.5 — 2020-12-18
- 0.0.4 — 2020-02-01
- 0.0.3 — 2020-01-11
- 0.0.2 — 2019-11-28
- 0.0.1 — 2019-11-22

## README

<div align="center">
  <img src="https://cloud.githubusercontent.com/assets/399657/23590290/ede73772-01aa-11e7-8915-181ef21027bc.png" />

  <div>a plugin for <a href="https://github.com/spencermountain/compromise/">compromise</a></div>
  
  <!-- npm version -->
  <a href="https://npmjs.org/package/compromise-syllables">
    <img src="https://img.shields.io/npm/v/compromise-syllables.svg?style=flat-square" />
  </a>
  
  <!-- file size -->
  <a href="https://unpkg.com/compromise-syllables/builds/compromise-syllables.min.js">
    <img src="https://badge-size.herokuapp.com/spencermountain/compromise/master/plugins/syllables/builds/compromise-syllables.min.js" />
  </a>
   <hr/>
</div>

This is a naive syllable tokenizer, and simply splits a compromise document, according to some simple, biased interpretation.

It makes some judgement-calls about pronunciation, but also where splits make the most sense.

<div align="center">
  <code>npm install compromise-syllables</code>
</div>

<h3>
  <a href="https://observablehq.com/@spencermountain/compromise-syllables">Demo</a>
</h3>

```js
const nlp = require('compromise')
nlp.extend(require('compromise-syllables'))

let doc = nlp('Chocolate microscopes?')
doc.terms().syllables()
/*[
  {text:'Chocolate', syllables:['cho', 'co', 'late']},
  {text:'microscopes?', syllables:['mic', 'ro', 'scope']}
]*/
```

`.syllables( {options} )` will pass it's optional first parameter to `.json()`. You can see the full set of options [here](https://observablehq.com/@spencermountain/compromise-json).

Keep in mind there are cultural-differences in syllable pronunciation, which this library has a certain bias.

MIT

---
_Source: https://npm.io/package/compromise-syllables · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
