UNPKG

wordmap

Version:
49 lines (48 loc) 1.57 kB
import Alignment from "../structures/Alignment"; import AlignmentIndex from "./AlignmentIndex"; import NgramIndex from "./NgramIndex"; /** * A collection of indexes on the permutation of possible alignments. */ export default class PermutationIndex { /** * Alignment permutation frequency index. * The total number of occurrences within the alignment permutations. */ private alignPermFreqIndex; /** * Source n-gram permutation frequency index. * The total number of occurrences within the alignment permutations. */ private srcNgramPermFreqIndex; /** * Target n-gram permuation frequency index. * The total number of occurrences within the alignment permutations. */ private tgtNgramPermFreqIndex; /** * Returns an index of alignment frequencies in the permutations */ readonly alignmentFrequency: AlignmentIndex; /** * Returns an index of source n-gram frequencies in the permutations * @return {NgramIndex} */ readonly sourceNgramFrequency: NgramIndex; /** * Returns an index of target n-gram frequencies in the permutations * @return {NgramIndex} */ readonly targetNgramFrequency: NgramIndex; constructor(); /** * Adds a sentence alignment to the index. * @param {Alignment[]} alignments - an array of alignments to add */ addAlignments(alignments: Alignment[]): void; /** * Adds a single alignment to the index * @param alignment */ addAlignment(alignment: Alignment): void; }