UNPKG

wordmap

Version:
30 lines (29 loc) 953 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Algorithm_1 = require("../Algorithm"); /** * Calculations the equivalence of the target n-gram with the source n-gram. * This is primarily useful when aligning texts within the same language. * e.g. to uncover variations within the text such as spelling and word order. */ class NgramEquality extends Algorithm_1.default { constructor() { super(...arguments); this.name = "n-gram equality"; } /** * Load data into the predictions * @param predictions * @param cIndex * @param saIndex * @param usIndex */ execute(prediction, cIndex, saIndex, usIndex) { // TODO: implement algorithm. // compare text // compare lemma // using Levenstein's distance for comparisons https://www.npmjs.com/package/levenshtein return prediction; } } exports.default = NgramEquality;