UNPKG

wordmap

Version:
16 lines (15 loc) 563 B
import Algorithm from "../Algorithm"; import Prediction from "../structures/Prediction"; /** * This algorithm calculates the relative position of n-grams in a sentence. * Only literal translations are supported. * * A very high score indicates the aligned n-grams are in the same relative position. * A very low score indicates the aligned n-grams occur on opposite sides of the sentence. * * Results range from near 0 to 1 */ export default class AlignmentPosition extends Algorithm { name: string; execute(prediction: Prediction): Prediction; }