UNPKG

wordmap

Version:
36 lines (35 loc) 991 B
import Prediction from "./Prediction"; /** * A translation suggestion */ export default class Suggestion { /** * Sorts predictions by token position * @param {Prediction[]} predictions - the predictions to sort * @return {Prediction[]} */ static sortPredictions(predictions: Prediction[]): Prediction[]; private predictions; constructor(); /** * Adds a prediction to the suggestion. * @param {Prediction} prediction */ addPrediction(prediction: Prediction): void; getPredictions(): Prediction[]; /** * Returns the compounded confidence score of all predictions within the suggestion. * @return {number} */ compoundConfidence(): number; /** * Prints a user friendly form of the suggestion */ toString(): string; /** * Outputs the alignment predictions to json * @param verbose - print full metadata * @return {object} */ toJSON(verbose?: boolean): object; }