Automatic hyphenation for Shavian text. Inserts soft hyphens (U+00AD) at syllable boundaries using the Maximal Onset Principle.
This approach produces phonetically natural breaks that may seem unfamiliar to readers accustomed to conventional English orthography. For example, "button" hyphenates as 𐑚𐑳-𐑑𐑩𐑯 rather than but-ton, and "silent" as 𐑕𐑲-𐑤𐑩𐑯𐑑 rather than si-lent.
Available as a JavaScript library, CLI tool, and WordPress plugin.
Requires Node.js 12+ and make.
make # Build library, CLI, and man page
make test # Run tests
make install # Install CLI and man page globally
make wordpress-plugin # Build WordPress plugin zipVersion is automatically determined from git tags.
# From stdin
echo "𐑥𐑰𐑑𐑦𐑙" | shyphenate
# Output: 𐑥𐑰-𐑑𐑦𐑙
# From file
shyphenate document.txt
# With custom minimum word length
shyphenate --min-length 6 document.txtconst { syllabify, insertShyBreaks } = require('shyphenate');
// Syllabify a word
const syllables = syllabify('𐑥𐑰𐑑𐑦𐑙');
// Returns: ['𐑥𐑰', '𐑑𐑦𐑙']
// Insert soft hyphens in text
const hyphenated = insertShyBreaks('𐑥𐑰𐑑𐑦𐑙 𐑚𐑳𐑑𐑩𐑯');
// Returns: '𐑥𐑰𐑑𐑦𐑙 𐑚𐑳𐑑𐑩𐑯' (soft hyphens invisible until line breaks)
// With options
const hyphenated = insertShyBreaks(text, { minLength: 6 });- Build the plugin:
make wordpress-plugin - Upload
dist/wordpress-plugin/shyphenate.zipto WordPress - Activate the plugin
The plugin automatically hyphenates Shavian text on both the front-end and in the block editor.
- silent: 𐑕𐑲𐑤𐑩𐑯𐑑
- meeting: 𐑥𐑰𐑑𐑦𐑙
- button: 𐑚𐑳𐑑𐑩𐑯
- instances: 𐑦𐑯𐑕𐑑𐑩𐑯𐑕𐑩𐑟
Jonathan Ross Website: joro.io GitHub: cozmic72
MIT