intellij-randomness / com.fwdekker.randomness.word / DictionaryReference / <init>

<init>

DictionaryReference(isBundled: Boolean, filename: String)

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.