intellij-randomness / com.fwdekker.randomness.word / BundledDictionary

BundledDictionary

class BundledDictionary : Dictionary

A Dictionary of which the underlying file is a resource in the JAR.

Properties

filename

val filename: String

the path to the resource file

words

val words: Set<String>

The words in the dictionary.

Functions

equals

fun equals(other: Any?): Boolean

Returns true iff this dictionary's filename equals other's filename.

hashCode

fun hashCode(): Int

Returns the hash code of the filename.

toString

fun toString(): String

Returns a human-readable string of the dictionary's filename.

validate

fun validate(): Unit

Throws an InvalidDictionaryException iff this dictionary is currently invalid.

Inherited Functions

isValid

open fun isValid(): Boolean

Returns true iff validate does not throw an exception.

Companion Object Properties

cache

val cache: Cache<String, BundledDictionary>

The cache of bundled dictionaries, used to improve word generation times.

SIMPLE_DICTIONARY

const val SIMPLE_DICTIONARY: String

The location of a simple English dictionary.