UNPKG

wordmap

Version:
38 lines (37 loc) 1.24 kB
import GlobalAlgorithm from "../GlobalAlgorithm"; import AlignmentMemoryIndex from "../index/AlignmentMemoryIndex"; import CorpusIndex from "../index/CorpusIndex"; import Prediction from "../structures/Prediction"; /** * This algorithm calculates the frequency of n-gram occurrences. */ export default class NgramFrequency extends GlobalAlgorithm { /** * Performs a numerical addition with the value of a key in a number object. * TODO: move this into it's own class? * * @param {NumberObject} object * @param {string} key * @param {number} value */ private static addObjectNumber; /** * Performs a numerical division. * Division by zero will result in 0. * TODO: move this into a math utility? * * @param {number} dividend * @param {number} divisor * @return {number} */ private static divideSafe; name: string; /** * Load data into the predictions * @param predictions [description] * @param cIndex [description] * @param saIndex [description] * @return [description] */ execute(predictions: Prediction[], cIndex: CorpusIndex, saIndex: AlignmentMemoryIndex): Prediction[]; }