PHPackages                             cballou/php-syllable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cballou/php-syllable

ActiveLibrary

cballou/php-syllable
====================

A refactoring of vanderlee/phpSyllable for Packagist.

184TeX

Since Sep 10Pushed 10y agoCompare

[ Source](https://github.com/cballou/php-syllable)[ Packagist](https://packagist.org/packages/cballou/php-syllable)[ RSS](/packages/cballou-php-syllable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Syllable
========

[](#syllable)

Version 1.4.1

[![Build Status](https://camo.githubusercontent.com/c216ebd9352cbbf5334569dc664c2678f298ac252c59ae645b1d55e7961807e3/68747470733a2f2f7472617669732d63692e6f72672f76616e6465726c65652f70687053796c6c61626c652e737667)](https://travis-ci.org/vanderlee/phpSyllable)

Copyright © 2011-2015 Martijn van der Lee. MIT Open Source license applies.

Introduction
------------

[](#introduction)

PHP Syllable splitting and hyphenation. or rather... PHP Syl-la-ble split-ting and hy-phen-ation.

Based on the work by Frank M. Liang () and the many volunteers in the TeX community.

Many languages supported. i.e. english (us/uk), spanish, german, french, dutch, italian, romanian, russian, etc. 76 languages in total.

Language sources:

Supports PHP 5.2 and up, so you can use it on older servers.

Example Usage
-------------

[](#example-usage)

```
// must set the proper paths for a cache dir and the TeX language file dir
Syllable::setCacheDir(realpath('cache'));
Syllable::setLanguageDir(realpath('languages'));

$syllable = new Syllable();
$syllable->setHyphen('-');
$syllable->setLanguage('en-us');

// Su-per-cal-ifrag-ilis-tic-ex-pi-ali-do-cious
$syllable->hyphenateText('Supercalifragilisticexpialidocious')

// array(';Re', 'dun', 'dan', 't, punc', 'tu', 'a', 'tion...')
$syllable->splitWord(';Redundant, punctuation...');

// array(';Re', 'dun', 'dant, punc', 'tu', 'a', 'tion...')
$syllable->splitText(';Redundant, punctuation...');
```

Changes
-------

[](#changes)

1.4.1

- More fixes for apostrophes in splitting.

1.4

- Fix for French language handling
- Refactor .text loading into source class.
- Massive cache performance increase (excessive writes).

1.3.1

- Fix slow initial cache writing; too many writes (only one was needed).
- Removed min\_hyphenation; mb\_strlen takes more time than hashmap lookup.

1.3

- Added `array histogramText($text)`, `integer countWordsText($text)` and `integer countPolysyllableText($text)` methods.
- Refactored cache interface.
- Improved unittests.

1.2

- Deprecated treshold feature. Was based on misinterpretation of the algorithm. Methods, constants and constructor signature unchanged, although you can now omit the treshold if you want (or leave it in, it's detected as a "fake" treshold).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/166784?v=4)[Corey Ballou](/maintainers/cballou)[@cballou](https://github.com/cballou)

---

Top Contributors

[![vanderlee](https://avatars.githubusercontent.com/u/649240?v=4)](https://github.com/vanderlee "vanderlee (60 commits)")[![cballou](https://avatars.githubusercontent.com/u/166784?v=4)](https://github.com/cballou "cballou (4 commits)")

### Embed Badge

![Health badge](/badges/cballou-php-syllable/health.svg)

```
[![Health](https://phpackages.com/badges/cballou-php-syllable/health.svg)](https://phpackages.com/packages/cballou-php-syllable)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
