PHPackages                             albertofem/kanjidic2-lib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. albertofem/kanjidic2-lib

ActiveLibrary[Database &amp; ORM](/categories/database)

albertofem/kanjidic2-lib
========================

PHP library to work with KANJIDIC2 kanji database

2101PHP

Since May 9Pushed 11y agoCompare

[ Source](https://github.com/albertofem/kanjidic2-lib)[ Packagist](https://packagist.org/packages/albertofem/kanjidic2-lib)[ RSS](/packages/albertofem-kanjidic2-lib/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

README
======

[](#readme)

[![Build Status](https://camo.githubusercontent.com/8ffdb7b98e3c082afcc2dec2bf9d3ef5691e04a32d76dd4af50c2e059412c491/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c626572746f66656d2f6b616e6a69646963322d6c69622e706e67)](http://travis-ci.org/albertofem/kanjidic2-lib) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7f3fba02cecc6073f2f4b788675a058a1969d452031fe0741a5cafe7eb3801c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c626572746f66656d2f6b616e6a69646963322d6c69622f6261646765732f7175616c6974792d73636f72652e706e673f733d63366439336265663636333130613231616361336664636566373833356166613365313130306165)](https://scrutinizer-ci.com/g/albertofem/kanjidic2-lib/)

Requirements
------------

[](#requirements)

PHP &gt;= 5.3

Installation
------------

[](#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
-----

[](#usage)

Create new Kanjidic instance:

```
