skoro / stardict
Provides interface to StarDict dictionaries.
0.2.1
2023-06-29 17:43 UTC
Requires
- php: >=7.4
- ext-zlib: *
Requires (Dev)
- phpspec/prophecy: ^1.15
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.4
- symfony/var-dumper: ^5.1
README
Provides PHP interface to StarDict dictionaries.
Install via composer:
composer require skoro/stardict
Usage
use StarDict\StarDict; require dirname(__FILE__) . '/vendor/autoload.php'; $dict = StarDict::createFromFiles('dict.ifo', 'dict.idx', 'dict.dict.dz'); echo $dict->getDict()->getBookname(); // show dict name. foreach ($dict->get('word') as $result) { echo $result->getValue(); }
Caveats
- Only 2.4.2 StarDict version is supported.
- Option
sametypesequence
is required and cannot be empty.