DictionaryReference

data class DictionaryReference(val isBundled: Boolean, var filename: String) : Dictionary(source)

References a dictionary by its properties.

Using a reference, each access goes through the cache first, so that outdated instances of a dictionary (i.e. those flushed when clearing the cache) are not used anymore. This ensures that only the latest instance of that dictionary is used, which is important when a dictionary has to be used both before and after clearing a cache.

Constructors

Link copied to clipboard
constructor(isBundled: Boolean, filename: String)

Types

Link copied to clipboard
object Companion

Holds static elements.

Properties

Link copied to clipboard
var filename: String

The filename of the referred-to dictionary.

Link copied to clipboard
val isBundled: Boolean

True if this dictionary refers to a BundledDictionary.

Link copied to clipboard

The dictionary that is referred to by this reference, as fetched from the cache.

Link copied to clipboard
open override val words: Set<String>

The words in the dictionary.

Functions

Link copied to clipboard
open fun isValid(): Boolean

Returns true iff validate does not throw an exception.

Link copied to clipboard
open override fun toString(): String

Returns the string representation of the referent.

Link copied to clipboard
open override fun validate()

Throws an InvalidDictionaryException iff this dictionary is currently invalid.