contextl 1.2.26 → 1.2.28
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.
- package/package.json +1 -1
- package/python/query_engine.py +3 -2
- package/requirements.txt +2 -0
package/package.json
CHANGED
package/python/query_engine.py
CHANGED
|
@@ -65,9 +65,10 @@ class RankedFile:
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
def _tokenize(text: str) -> list[str]:
|
|
68
|
-
"""Lowercase, split on non-alphanumeric, remove stop words."""
|
|
68
|
+
"""Lowercase, split on non-alphanumeric, remove stop words, deduplicate."""
|
|
69
69
|
tokens = re.findall(r"[a-z0-9]+", text.lower())
|
|
70
|
-
|
|
70
|
+
# Deduplicate while preserving order
|
|
71
|
+
return list(dict.fromkeys(t for t in tokens if t not in STOP_WORDS and len(t) > 1))
|
|
71
72
|
|
|
72
73
|
|
|
73
74
|
def _path_tokens(path: str) -> list[str]:
|