UNPKG

wordmap

Version:
28 lines (27 loc) 943 B
import Ngram from "../structures/Ngram"; import FrequencyIndex from "./FrequencyIndex"; /** * An index of n-gram frequencies */ export default class NgramIndex extends FrequencyIndex { /** * Reads a value from the index * @param ngram - the n-gram index to read. This may be a specific key, or the ngram object to read the default key. */ read(ngram: Ngram | string): number; /** * Writes a value to the index * @deprecated - use {@link increment} instead * @param {Ngram} ngram - the n-gram index to write * @param {number} value */ write(ngram: Ngram, value: number): void; /** * Increments the n-gram frequency. * This will increment all of the important keys in the n-gram such as * the words in question, lemma, etc. * @param {Ngram} ngram - the n-gram index to add * @param {number} value */ increment(ngram: Ngram, value?: number): void; }