skoro / stardict

PHP interface to StarDict dictionaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StarDict

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.

About

PHP interface to StarDict dictionaries


Languages

Language:PHP 100.0%