@thi.ng/text-analysis 0.4.6 → 0.4.9
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/CHANGELOG.md +8 -1
- package/README.md +5 -0
- package/cluster.js +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-07-
|
|
3
|
+
- **Last updated**: 2025-07-21T08:21:58Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -11,6 +11,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
### [0.4.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/text-analysis@0.4.7) (2025-07-20)
|
|
15
|
+
|
|
16
|
+
#### 🩹 Bug fixes
|
|
17
|
+
|
|
18
|
+
- fix [#532](https://github.com/thi-ng/umbrella/issues/532), fix centralTermsVec() ([6e19974](https://github.com/thi-ng/umbrella/commit/6e19974))
|
|
19
|
+
- update non-zero check
|
|
20
|
+
|
|
14
21
|
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/text-analysis@0.4.0) (2025-06-18)
|
|
15
22
|
|
|
16
23
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -81,6 +81,11 @@ Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
|
|
|
81
81
|
|
|
82
82
|
### Code example
|
|
83
83
|
|
|
84
|
+
> [!NOTE]
|
|
85
|
+
> For illustrative purposes only! Due to the active nature of the larger project
|
|
86
|
+
> repo, example results/output might vary since this code was written
|
|
87
|
+
> originally...
|
|
88
|
+
|
|
84
89
|
```ts tangle:export/readme-1.ts
|
|
85
90
|
import { files, readJSON } from "@thi.ng/file-io";
|
|
86
91
|
import {
|
package/cluster.js
CHANGED
|
@@ -34,7 +34,7 @@ function clusterBounds(docs, ids) {
|
|
|
34
34
|
}
|
|
35
35
|
const centralTerms = (vocab, k, docs) => centralTermsVec(vocab, k, mean([], docs));
|
|
36
36
|
const centralTermsVec = (vocab, k, centroid) => vocab.getAllIDs(
|
|
37
|
-
argSort(centroid, (a, b) => b - a).slice(0, k).filter(
|
|
37
|
+
argSort(centroid, (a, b) => b - a).slice(0, k).filter((i) => centroid[i] != 0)
|
|
38
38
|
);
|
|
39
39
|
const knearest = (query, k, r = Infinity, dist = JACCARD_DIST_DENSE, sorted = false) => $knearest(query, k, r, dist, sorted);
|
|
40
40
|
const knearestDocs = (query, k, docs, r = Infinity, dist = JACCARD_DIST_DENSE, sorted = false) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/text-analysis",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Text tokenization, transformation & analysis transducers, utilities, stop words, porter stemming, vector encodings, similarities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.11.
|
|
43
|
-
"@thi.ng/arrays": "^2.13.
|
|
44
|
-
"@thi.ng/bidir-index": "^1.3.
|
|
45
|
-
"@thi.ng/checks": "^3.7.
|
|
46
|
-
"@thi.ng/distance": "^3.0.
|
|
47
|
-
"@thi.ng/k-means": "^2.0.
|
|
48
|
-
"@thi.ng/strings": "^3.9.
|
|
49
|
-
"@thi.ng/transducers": "^9.6.
|
|
50
|
-
"@thi.ng/vectors": "^8.
|
|
42
|
+
"@thi.ng/api": "^8.11.32",
|
|
43
|
+
"@thi.ng/arrays": "^2.13.5",
|
|
44
|
+
"@thi.ng/bidir-index": "^1.3.3",
|
|
45
|
+
"@thi.ng/checks": "^3.7.12",
|
|
46
|
+
"@thi.ng/distance": "^3.0.7",
|
|
47
|
+
"@thi.ng/k-means": "^2.0.5",
|
|
48
|
+
"@thi.ng/strings": "^3.9.18",
|
|
49
|
+
"@thi.ng/transducers": "^9.6.3",
|
|
50
|
+
"@thi.ng/vectors": "^8.4.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"esbuild": "^0.25.
|
|
53
|
+
"esbuild": "^0.25.8",
|
|
54
54
|
"typedoc": "^0.28.7",
|
|
55
55
|
"typescript": "^5.8.3"
|
|
56
56
|
},
|
|
@@ -141,5 +141,5 @@
|
|
|
141
141
|
"status": "alpha",
|
|
142
142
|
"year": 2021
|
|
143
143
|
},
|
|
144
|
-
"gitHead": "
|
|
144
|
+
"gitHead": "11747c482773d3da03c8b7848b25a56251ccd759\n"
|
|
145
145
|
}
|