collective-memory-mcp 0.6.1 → 0.6.2
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/src/vector-search.js +3 -2
package/package.json
CHANGED
package/src/vector-search.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Tokenize text into terms
|
|
9
9
|
* - Converts to lowercase
|
|
10
|
-
* - Removes special characters
|
|
10
|
+
* - Removes special characters (but keeps internal hyphens in compound words)
|
|
11
11
|
* - Splits into words
|
|
12
12
|
* - Filters stop words
|
|
13
13
|
*/
|
|
@@ -32,7 +32,8 @@ function tokenize(text) {
|
|
|
32
32
|
|
|
33
33
|
return text
|
|
34
34
|
.toLowerCase()
|
|
35
|
-
|
|
35
|
+
// Replace special chars with space, but keep word chars and internal hyphens
|
|
36
|
+
.replace(/[^\w\s-]/g, " ")
|
|
36
37
|
.split(/\s+/)
|
|
37
38
|
.filter(word => word.length > 2 && !stopWords.has(word));
|
|
38
39
|
}
|