Interface IDictionary

All Superinterfaces:
AutoCloseable

public interface IDictionary extends AutoCloseable
Interface for dictionary access.

Each dictionary format reader should implement this interface. Each instance of this interface represents one dictionary.

Implementers are encouraged to use DictionaryData to store their data. A simple implementation can just load its entire data at once, but we don't recommend it because it's very memory-intensive.

Instead we recommend that you read the dictionary's index (article titles) and store some short data, like article offsets into the dictionary file, as the value. In your implementation of the readArticles* methods you can use these offsets to actually load the content from disk. The OS will cache dictionary file against slow access.

See StarDict for an example of the recommended deferred-loading implementation, and LingvoDSL for an example of an simpler, up-front loading implementation.