@handsupmin/gc-tree 0.7.14 → 0.7.15
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/dist/src/resolve.js +3 -2
- package/package.json +1 -1
package/dist/src/resolve.js
CHANGED
|
@@ -10,11 +10,12 @@ const STOP_WORDS = new Set([
|
|
|
10
10
|
'vs', 'per', 'set', 'get', 'run', 'add', 'use', 'new', 'old', 'all', 'any',
|
|
11
11
|
]);
|
|
12
12
|
function tokenize(text) {
|
|
13
|
-
// Split on whitespace, punctuation, and symbols — preserving Unicode letters
|
|
14
|
-
// and digits (including Korean, Japanese, CJK, etc.).
|
|
15
13
|
return String(text || '')
|
|
16
14
|
.toLowerCase()
|
|
17
15
|
.split(/[^\p{L}\p{N}]+/u)
|
|
16
|
+
// Split at ASCII/non-ASCII boundaries so Korean particles don't corrupt ASCII tokens
|
|
17
|
+
// e.g. "fco가" → ["fco", "가"], "g3에서" → ["g3", "에서"]
|
|
18
|
+
.flatMap((t) => t.split(/(?<=[a-z0-9])(?=[^\x00-\x7f])|(?<=[^\x00-\x7f])(?=[a-z0-9])/))
|
|
18
19
|
.filter((t) => t.length >= 2 && !STOP_WORDS.has(t));
|
|
19
20
|
}
|
|
20
21
|
function makeTokenRegex(token) {
|