siiptuo / voikko
bindings for libvoikko
v0.1.0
2021-05-15 09:57 UTC
Requires
- php: >=7.4
- ext-ffi: *
- ext-mbstring: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.18
- phpstan/phpstan: ^0.12.79
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2025-07-15 19:17:25 UTC
README
voikko-php
PHP bindings for libvoikko based on PHP FFI.
Requirements
- PHP 7.4 or newer with FFI and Multibyte String extensions enabled
- libvoikko (
libvoikko1
package in Ubuntu) - Voikko dictionary (
voikko-fi
package in Ubuntu)
Installation
Install via Composer:
composer require siiptuo/voikko
Example
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.
License
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