Skip to content

Commit 097afdc

Browse files
committed
docs: remove unused search scorer helpers
1 parent af7d6aa commit 097afdc

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

docs/_static/search_scorer.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ var Scorer = {
4848
const trimmedFilename = (filename || "").trim();
4949
const trimmedDocName = (docName || "").trim();
5050

51-
const lowerTitle = trimmedTitle.toLowerCase();
5251
const lowerDescription = trimmedDescription.toLowerCase();
5352
const lowerFilename = trimmedFilename.toLowerCase();
5453
const lowerDocName = trimmedDocName.toLowerCase();
@@ -64,7 +63,6 @@ var Scorer = {
6463
const parentTitle =
6564
titleParts.length > 1 ? titleParts.slice(0, -1).join("::") : "";
6665
const normalizedLeaf = _normalizeSearchSymbol(leaf);
67-
const normalizedTitle = _normalizeSearchSymbol(trimmedTitle);
6866
const normalizedParent = _normalizeSearchSymbol(parentTitle);
6967
const normalizedLeafOnlyQuery = _normalizeSearchSymbol(
7068
query.includes("::") ? query.split("::").pop() : query,
@@ -76,15 +74,6 @@ var Scorer = {
7674
!/[.:/_]/.test(lowerQuery) &&
7775
/^[a-z0-9]+$/.test(lowerQuery);
7876

79-
// Heuristic buckets
80-
const looksLikeGenericConceptPage =
81-
/^(algorithms?|transformations?|utilities|overview|guide|examples?)$/i.test(
82-
trimmedTitle,
83-
) ||
84-
/(api documentation|algorithms|overview|general concepts)/i.test(
85-
lowerDescription,
86-
);
87-
8877
const looksLikeNamespaceQualified =
8978
/^[a-zA-Z_]\w*(::[a-zA-Z_]\w*)+/.test(trimmedTitle);
9079

@@ -105,12 +94,9 @@ var Scorer = {
10594
const isConstructorLike =
10695
isNestedSymbol &&
10796
_normalizeSearchSymbol(titleParts[symbolDepth - 2]) === normalizedLeaf;
108-
const hasQueryInTitle = lowerQuery && lowerTitle.includes(lowerQuery);
10997
const hasQueryInFilename =
11098
lowerQuery && lowerFilename.includes(lowerQuery);
11199
const hasQueryInDocName = lowerQuery && lowerDocName.includes(lowerQuery);
112-
const hasStrongMetadataMatch =
113-
hasQueryInTitle || hasQueryInFilename || hasQueryInDocName;
114100
const isEnumeratorLike =
115101
/(C\+\+ enumerator\b)/i.test(trimmedDescription) || /^[A-Z0-9_]+$/.test(leaf);
116102
const isInternalHelperLike =
@@ -121,10 +107,6 @@ var Scorer = {
121107
trimmedTitle,
122108
);
123109
const isPythonModuleLike = /(Python module\b)/i.test(trimmedDescription);
124-
const isCompactLeafMatch =
125-
normalizedLeafOnlyQuery &&
126-
normalizedLeaf.includes(normalizedLeafOnlyQuery) &&
127-
normalizedLeaf.length <= normalizedLeafOnlyQuery.length + 18;
128110
const leafStartsWithQueryWord =
129111
queryWords.length === 1 && leafWords[0] === queryWords[0];
130112
const leafEndsWithQueryWord =

0 commit comments

Comments
 (0)