wordmap
Version:
Multi-Lingual Word Alignment Prediction
32 lines (31 loc) • 1.11 kB
TypeScript
import Algorithm from "../Algorithm";
import AlignmentMemoryIndex from "../index/AlignmentMemoryIndex";
import CorpusIndex from "../index/CorpusIndex";
import UnalignedSentenceIndex from "../index/UnalignedSentenceIndex";
import Prediction from "../structures/Prediction";
/**
* A commonly seen pattern in translation is that word repetition in the primary text
* is often seen in the secondary text.
*/
export default class AlignmentOccurrences extends Algorithm {
/**
* Calculates the
* @param sourceNgramFrequency
* @param targetNgramFrequency
*/
static calc(sourceNgramFrequency: number, targetNgramFrequency: number): number;
/**
* Calculates the weight based on the word
* @param p
* @param usIndex
*/
private static calcOccurrenceSimilarity;
/**
* Calculates the weight based on the lemma
* @param p
* @param usIndex
*/
private static calcLemmaOccurrenceSimilarity;
name: string;
execute(prediction: Prediction, cIndex: CorpusIndex, saIndex: AlignmentMemoryIndex, usIndex: UnalignedSentenceIndex): Prediction;
}