507
}
508
}
510
>
// Finally compute description + label scores if we have a description
511
>
if (description) {
512
>
let descriptionPrefix = description;
513
>
if (!!path) {
514
>
descriptionPrefix = `${description}${sep}`; // assume this is a file path
515
>
}
516
>
517
>
const descriptionPrefixLength = descriptionPrefix.length;
518
>
const descriptionAndLabel = `${descriptionPrefix}${label}`;
519
>
520
>
const [labelDescriptionScore, labelDescriptionPositions] = scoreFuzzy(
521
>
descriptionAndLabel,
522
>
query.normalized,
523
>
query.normalizedLowercase,
524
>
allowNonContiguousMatches && !query.expectContiguousMatch);
525
>
if (labelDescriptionScore) {
526
const labelDescriptionMatches = createMatches(labelDescriptionPositions);
527
const labelMatch: IMatch[] = [];