Creating & Loading Dictionaries

Dictionaries can be loaded using the ChineseDictionary constructor. Currently, dictionaries can only be loaded from text files, but there may be support for other formats in the future.

CEDICT.ChineseDictionaryType
ChineseDictionary([filename])

Load a text-based dictionary either from the default dictionary file or from the provided filename. The format of the text file must be the same as that used by the CC-CEDICT project for compatibility reasons.

For general use, it's the easiest to just use the default dictionary (from the CC-CEDICT project). This is loaded if you don't specify a filename. This dictionary is updated from the official project page every so often.

File Format for a Text-Based Dictionary

See the formatting guide for the CC-CEDICT project for how each line should be formatted (just consider the formatting elements and not necessarily the other notes on translation/dictionary entry creation). Each line of the file should be a single entry; for examples, see the small test dictionaries in the repository. Lines starting with a "#" are treated as comments and ignored.