UNPKG

wordmap

Version:
32 lines (31 loc) 904 B
/** * An index of frequencies */ export default abstract class FrequencyIndex { private index; private newCounter; private totalCount; private logCountThreshold; private slowDownThreshold; constructor(); /** * Reads a value from the index. * If the key does not exist the result will be 0. * @param {string} key */ protected readIndex(key: string): number; /** * Adds a number to the key's value. * If no number is given the default amount will be added to the value. * @param key * @param value - optional value to add */ protected incrementIndex(key: string, value?: number): void; /** * Manually writes a value to the index * @deprecated use {@link incrementIndex} instead. * @param {string} key * @param {number} value */ protected writeIndex(key: string, value: number): void; }