function normalizeTfIdfScores(scores) {
    var _a, _b;
    // copy of scores
    const result = scores.slice(0);
    // sort descending
    result.sort((a, b) => b.score - a.score);
    // normalize
    const max = (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.score) !== null && _b !== void 0 ? _b : 0;
    if (max > 0) {
        for (const score of result) {
            score.score /= max;
        }
    }
    return result;
}
Normalize the scores to be between 0 and 1 and sort them decending.
@param scores array of scores from {@link TfIdfCalculator.calculateScores}
@returns normalized scores