FrequencyDictionary

data class FrequencyDictionary(val formatVersion: Int = FORMAT_VERSION.toInt(), val ngrams: Int, val locale: String, val termCount: Int, val terms: MutableMap<String, Long> = mutableMapOf<String, Long>())(source)

An in-memory frequency dictionary as decoded from a .fdic file.

Constructors

Link copied to clipboard
constructor(formatVersion: Int = FORMAT_VERSION.toInt(), ngrams: Int, locale: String, termCount: Int, terms: MutableMap<String, Long> = mutableMapOf<String, Long>())

Properties

Link copied to clipboard

The .fdic format version the data conforms to.

Link copied to clipboard

The locale the dictionary applies to.

Link copied to clipboard
val ngrams: Int

The ngram size of the terms: 1 for unigrams, 2 for bigrams.

Link copied to clipboard

The number of terms the dictionary is expected to contain.

Link copied to clipboard

The terms mapped to their frequencies.

Functions

Link copied to clipboard

Returns the human-readable name of the ngram size: "Unigram" or "Bigram".

Link copied to clipboard
fun validate()

Validates the header fields.