@arsedizioni/ars-utils 21.1.91 → 21.1.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1311,7 +1311,8 @@ class ClipperDocumentComponent extends ClipperDocumentManager {
1311
1311
  });
1312
1312
  maxScore = maxScore - minScore;
1313
1313
  r.value.items[0].anchors.forEach(n => {
1314
- let score = (n.score - minScore) / maxScore || 1;
1314
+ let score = maxScore > 0 ? (n.score - minScore) / maxScore : 0;
1315
+ console.log('Anchor score', n.score, minScore, maxScore, score);
1315
1316
  n.score = score;
1316
1317
  n.veryRelevant = score > 0.7;
1317
1318
  });
@@ -2193,7 +2194,7 @@ class ClipperSearchResultManager extends ClipperDocumentManager {
2193
2194
  anchors.push({ text: a.typeDescription });
2194
2195
  anchorType = a.type;
2195
2196
  }
2196
- let score = (a.score - minScore) / maxScore || 1;
2197
+ let score = maxScore > 0 ? (a.score - minScore) / maxScore : 0;
2197
2198
  anchors.push({
2198
2199
  text: a.text,
2199
2200
  title: a.title,