dev-master
9999999-dev https://github.com/mdsills/cccedictParser for CC-CEDICT Chinese-English dictionary
MIT
The Requires
- php >=7.0
dictionary chinese cc-cedict
Wallogit.com
2017 © Pedro Peláez
Parser for CC-CEDICT Chinese-English dictionary
This parser is written for >= PHP7. It will not work on PHP5., (*1)
Download the current CC-CEDICT file from https://www.mdbg.net/chinese/dictionary?page=cc-cedict into the demo folder., (*2)
cd demo composer install wget -O cedict.gz https://www.mdbg.net/chinese/export/cedict/cedict_1_0_ts_utf-8_mdbg.txt.gz php -f index.php
Reads from a CC-CEDICT Chinese dictionary file, and outputs structured data., (*3)
The parser will return an array with: - an array of Entry objects filled with data as per your configuration (see below) - an array of any skipped lines - the number of parsed lines - the number of skipped lines, (*4)
By default, the parser will fill the Entry object with: - an array of English translations from the dictionary entry - an array of traditional characters from the dictionary entry - an array of simplified characters from the dictionary entry, (*5)
With setOptions(array) (see above), you can change the data included in the Entry object. If any options are set, the Entry will not include any data that is not specified with setOptions()!
- Entry::F_ORIGINAL includes the original unparsed line from CC-CEDICT
- Entry::F_TRADITIONAL includes a string with the dictionary entry in traditional characters
- Entry::F_SIMPLIFIED same as above but in simplified characters
- Entry::F_PINYIN includes a string of pinyin as formatted in CC-CEDICT (numeric but with ideosyncrasies)
- Entry::F_PINYIN_NUMERIC includes a string of pinyin converted to numeric Hanyu Pinyin
- Entry::F_PINYIN_DIACRITIC includes a string of pinyin converted to Hanyu Pinyin with diacritics
- Entry::F_ENGLISH includes a string with all the English translations for the dictionary entry
- Entry::F_ENGLISH_EXPANDED includes an array with the above English translations
- Entry::F_TRADITIONAL_CHARS includes an array of all traditional characters in the dictionary entry
- Entry::F_SIMPLIFIED_CHARS same as above but with simplified characters, (*6)
Parser for CC-CEDICT Chinese-English dictionary
MIT
dictionary chinese cc-cedict