DictionaryReference

data class DictionaryReference(isBundled: Boolean, 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

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

Types

Companion
Link copied to clipboard
object Companion
Holds static elements.

Functions

isValid
Link copied to clipboard
open fun isValid(): Boolean
Returns true iff validate does not throw an exception.
toString
Link copied to clipboard
open override fun toString(): String
Returns the string representation of the referent.
validate
Link copied to clipboard
open override fun validate()
Throws an InvalidDictionaryException iff this dictionary is currently invalid.

Properties

filename
Link copied to clipboard
var filename: String
The filename of the referred-to dictionary.
isBundled
Link copied to clipboard
val isBundled: Boolean
True if this dictionary refers to a BundledDictionary.
referent
Link copied to clipboard
val referent: Dictionary
The dictionary that is referred to by this reference, as fetched from the cache.
words
Link copied to clipboard
open override val words: Set<String>
The words in the dictionary.

Sources

jvm source
Link copied to clipboard