Each dictionary class derives from DictionaryBase, which provides export_dictionary and import_dictionary for saving to and loading from a file. These methods do not raise an exception if the file cannot be written or read, or if it has an invalid format.
defimport_dictionary(self,file_path):...
Parameter
Type
Description
file_path
str
The file to import from.
Raises
Description
RuntimeError
The call changes a dictionary that defines how the text of documents is divided into terms (see DictionaryRepository), and the index of the dictionary contains documents, is not in the IndexStatus.ready status or is disposed.
Example
# Import aliases from a filealiases.import_dictionary("./Aliases.dat")# Import homophones from a filehomophones.import_dictionary("./Homophones.dat")
Aliases
These names call import_dictionary too, limited to the overloads listed.