Eric Streit 65af6ea0c6 modification du programme pour traiter le pinyin dans les traductions | 5 năm trước cách đây | |
---|---|---|
.. | ||
demo | 5 năm trước cách đây | |
src | 5 năm trước cách đây | |
.gitignore | 5 năm trước cách đây | |
LICENSE | 5 năm trước cách đây | |
README.md | 5 năm trước cách đây | |
composer.json | 5 năm trước cách đây |
This parser is written for PHP7. It will not work on PHP5.
Download the current CC-CEDICT file from http://www.mdbg.net/chindict/chindict.php?page=cc-cedict into the demo folder.
cd demo
composer install
wget -O cedict.gz http://www.mdbg.net/chindict/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.
The parser will return an array with:
By default, the parser will fill the Entry object with:
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-CEDICTEntry::F_TRADITIONAL
includes a string with the dictionary entry in traditional charactersEntry::F_SIMPLIFIED
same as above but in simplified charactersEntry::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 PinyinEntry::F_PINYIN_DIACRITIC
includes a string of pinyin converted to Hanyu Pinyin with diacriticsEntry::F_ENGLISH
includes a string with all the English translations for the dictionary entryEntry::F_ENGLISH_EXPANDED
includes an array with the above English translationsEntry::F_TRADITIONAL_CHARS
includes an array of all traditional characters in the dictionary entryEntry::F_SIMPLIFIED_CHARS
same as above but with simplified characters