https://github.com/siiptuo/voikko-php
PHP bindings for libvoikko
https://github.com/siiptuo/voikko-php
finnish finnish-language-analysis php php-bindings php-ffi voikko
Last synced: 2 months ago
JSON representation
PHP bindings for libvoikko
- Host: GitHub
- URL: https://github.com/siiptuo/voikko-php
- Owner: siiptuo
- Created: 2021-02-25T15:16:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-15T10:01:49.000Z (almost 5 years ago)
- Last Synced: 2025-07-28T19:46:57.911Z (8 months ago)
- Topics: finnish, finnish-language-analysis, php, php-bindings, php-ffi, voikko
- Language: PHP
- Homepage: https://siiptuo.github.io/voikko-php/namespaces/siiptuo-voikko.html
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSES/CC0-1.0.txt
Awesome Lists containing this project
README
# voikko-php
PHP bindings for [libvoikko](https://voikko.puimula.org/) based on [PHP FFI](https://www.php.net/manual/en/book.ffi.php).
## Requirements
- PHP 7.4 or newer with [FFI](https://www.php.net/manual/en/book.ffi.php) and [Multibyte String](https://www.php.net/manual/en/book.mbstring.php) extensions enabled
- libvoikko (`libvoikko1` package in Ubuntu)
- Voikko dictionary (`voikko-fi` package in Ubuntu)
## Installation
Install via [Composer](https://getcomposer.org/):
```sh
composer require siiptuo/voikko
```
## Example
Running:
```php
$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](https://siiptuo.github.io/voikko-php/namespaces/siiptuo-voikko.html) 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