DictionaryReference

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

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
fun DictionaryReference(isBundled: Boolean, filename: String)

Types

Link copied to clipboard
object Companion

Holds static elements.

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.

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
val referent: Dictionary

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.

Sources

Link copied to clipboard