PHP script to process the CC-CEDICT dictionary. This script converts the CC-CEDICT dictionary into a MySQL table. However it can be easily used for other formats as well (check the foreach loop at the end.)
What information is stored in the entries can be looked up at the CC-CEDICT Wiki Page: http://cc-cedict.org/wiki/format:syntax
This script outputs:
- Traditional Hanzi
- Simplified Hanzi
- Pinyin with tone numbers (i.e. ni3 hao3)
- Pinyin with tone marks (i.e. nị̌ hǎo)
- (English) translation
-
Download cedict2mysql.php
-
Download and unzip the dictionary file. The dictionary can be found at: http://www.mdbg.net/chindict/chindict.php?page=cc-cedict
-
Run the script: php ./cedict2mysql.php cedict_ts.u8 dictionary > install.sql
-
Import the SQL
-
Done. Have fun. :)