cjklib is a library providing Han character related methods for CJKV languages
(Chinese, Japanese, Korean and Vietnamese).

Introduction
------------
cjklib provides language routines for handling Han characters (characters based
on Chinese characters named Hanzi, Kanji, Hanja and chu Han respectively) used
in writing of the Chinese, Japanese, infrequently the Korean and formerly the
Vietnamese language and languages.

Methods include character lookup functionality by reading, stroke count, stroke
order, radicals and character sub parts furthermore reading/romanization
conversion.

Documentation
-------------
The API includes a lot of documentation and the homepage provides an
increasing set of pages.

Installing
----------
If installing from the source package content has to be extracted from the
archive first. Then the files needed can be installed on the system by running:

# python setup.py install

This step isn't needed when installing from a binary package (.deb, .rpm).
Furthermore it is possible to run cjknife and buildcjkdb from the source
directory.

In either case the database needs to be created according to one's needs. The
build steps will take some minutes, depending on the tables created.

The build process is started by running:

# buildcjkdb.py -b GROUP

with GROUP being the name of a group of tables to be installed.

To use the full set of functions download the Unihan file
ftp://ftp.unicode.org/Public/UNIDATA/Unihan.zip
and run

# buildcjkdb -b cjklibData

from the directory containing the Unihan table and the pre-packaged data (the
source package's directory should suffice) to build all tables needed by the
cjklib package. Alternatively use e.g. 'fullMandarin' for data needed by the
library's functions for the Mandarin Chinese language.

A list of groups can be printed with 'buildcjkdb -l'. See 'buildcjkdb -h'
for all parameters of the build script.

Usage
-----
The main components of this package are accessible through the library. But
there is a small command line tool cjknife that offers some of the library's
functions. See "cjknife --help" for an overview.

This tool also offers simple access to dictionaries which have to be built
before use (e.g. buildcjkdb -b fullCEDICT). Currently supported are CEDICT,
HanDeDict.

To create the needed tables and indices for the CEDICT dictionary run
# buildcjkdb -b fullCEDICT

SQLite
-----
SQLite support should work out of the box. SQLite 3 is currently known to
work.

Currently only characters from the Basic Multilingual Plane (BMP) of Unicode
are supported, due to missing support in MySQL (see below). To enable full
support buildcjkdb needs to be told to use the appropriate building methods.

SQLite offers a full-text search with extension FTS3 which needs to be
compiled in to used. cjknife uses the full-text capabilities for the
dictionary search and performs a full table scan in fuzzy search if this
extension is not available. No full-text support is currently given for
MySQL.

MySQL
-----
With MySQL 5 the following CREATE command creates a database with utf8 as
character set using the general Unicode collation:

CREATE DATABASE cjklib DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

MySQL < 6 doesn't support true UTF-8, and uses a Version with max 3 bytes, so
characters outside the Basic Multilingual Plane (BMP) can't be encoded. Building
the Unihan database thus might result in Warnings, Characters above 0x20000
can't be built at all.

See above for full-text support.

Contributing
------------
If you are interested in contributing to cjklib or have any comments, please
contact <cburgmer@ira.uka.de>.
