Skip to content

albertofem/kanjidic2-lib

Repository files navigation

README

Build Status Scrutinizer Code Quality

Requirements

PHP >= 5.3

Installation

In order to use this library on another project, you must add the kanjidic2 dictionary file as a Composer repository:

"repositories": [
    {
        "type":"package",
        "package": {
            "name": "kanjidic2/kanjidic2",
            "version": "2.0",
            "dist": {
                "url": "http://www.csse.monash.edu.au/~jwb/kanjidic2/kanjidic2.xml.gz",
                "type": "file"
            }
        }
    }
],

Require this library using composer:

composer require albertofem/kanjidic2-lib

Install it:

composer update albertofem/kanjidic2-lib

Test everything is ok:

php vendor/albertofem/kanjidic2-lib/bin/kanjidic kanjidic:dictionary:show vendor/kanjidic2/kanjidic2/kanjidic2.xml.gz

You should see a large list of kanjis followed by the total count in the dictionary:

...

縉繁署者臭艹艹著褐視謁謹賓贈辶逸難響頻

Total dictionary entries: 13108

Usage

Create new Kanjidic instance:

<?php

use AFM\Kanjidic\Kanjidic;

$kanjidic = new Kanjidic("vendor/kanjidic2/kanjidic2/kanjidic2.xml.gz")

$kanji = $kanjidic->lookByLiteral("");

See Kanjidic class for more lookup methods

License

This library is under the MIT license.

About

Kanjidic PHP library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages