coral-media / php-snowball
Snowball (libstemmer) bindings for PHP
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:C
Type:php-ext
Ext name:ext-snowball
pkg:composer/coral-media/php-snowball
Requires
- php: >=8.1
README
Minimal PECL-style scaffold for a Snowball (libstemmer) extension with vendored sources.
Install using PIE
From sources
pie install --with-snowball
From Packagist
pie install coral-media/php-snowball --with-snowball
Further info PIE official repository
Build (from source)
phpize
./configure --with-snowball
make -j"$(nproc)"
make install
Usage
Basic stemming (defaults to English + UTF_8):
<?php echo snowball_stem('running'); // run
Explicit language + encoding:
<?php echo snowball_stem('corriendo', SNOWBALL_LANG_ES, SNOWBALL_ENCODING_UTF_8); // corr
Notes
- Vendored libstemmer sources live under
lib/libstemmer. - If PIE install or building from source fails with
'make' '-j10'" failedtry--make-parallel-jobs 1. Same procedure withmake -jif building from sources. Adjust to any convenient value.