UNPKG

wordmap

Version:
21 lines (20 loc) 947 B
import Algorithm from "../Algorithm"; import AlignmentMemoryIndex from "../index/AlignmentMemoryIndex"; import CorpusIndex from "../index/UnalignedSentenceIndex"; import UnalignedSentenceIndex from "../index/UnalignedSentenceIndex"; import Prediction from "../structures/Prediction"; /** * This algorithm checks the relative similarity of occurrence within the aligned sentences. * * Some algorithms that evaluate n-gram position can produce false positives * since, due to differences in sentence length, the wrong n-gram occurrence * may be positionally closer. * * This algorithm can be used to correct those false positives. * Results range from 0 to 1. */ export default class AlignmentRelativeOccurrence extends Algorithm { static calculate(prediction: Prediction): number; name: string; execute(prediction: Prediction, cIndex: CorpusIndex, saIndex: AlignmentMemoryIndex, usIndex: UnalignedSentenceIndex): Prediction; }