PHP bindings for libvoikko based on PHP FFI.
- PHP 7.4 or newer with FFI and Multibyte String extensions enabled
- libvoikko (
libvoikko1
package in Ubuntu) - Voikko dictionary (
voikko-fi
package in Ubuntu)
Install via Composer:
composer require siiptuo/voikko
Running:
$voikko = new \Siiptuo\Voikko\Voikko();
$word = "kissammeko";
echo " word: " . $word . PHP_EOL;
echo "hyphenation: " . $voikko->hyphenate($word) . PHP_EOL;
foreach ($voikko->analyzeWord($word) as $analysis) {
echo " base form: " . $analysis->baseForm . PHP_EOL;
}
outputs:
word: kissammeko
hyphenation: kis-sam-me-ko
base form: kissa
Check out API documentation for all available functionality.
Like libvoikko, these bindings can be used under one of the following licenses:
- Mozilla Public License, version 1.1
- GNU General Public License, version 2 or later
- GNU Lesser General Public License, version 2.1 or later