@thi.ng/text-analysis 0.4.6 → 0.4.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-07-10T14:20:23Z
3
+ - **Last updated**: 2025-07-20T14:56:01Z
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(Boolean)
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.6",
3
+ "version": "0.4.7",
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.30",
43
- "@thi.ng/arrays": "^2.13.3",
44
- "@thi.ng/bidir-index": "^1.3.1",
45
- "@thi.ng/checks": "^3.7.10",
46
- "@thi.ng/distance": "^3.0.4",
47
- "@thi.ng/k-means": "^2.0.2",
48
- "@thi.ng/strings": "^3.9.16",
49
- "@thi.ng/transducers": "^9.6.1",
50
- "@thi.ng/vectors": "^8.3.3"
42
+ "@thi.ng/api": "^8.11.31",
43
+ "@thi.ng/arrays": "^2.13.4",
44
+ "@thi.ng/bidir-index": "^1.3.2",
45
+ "@thi.ng/checks": "^3.7.11",
46
+ "@thi.ng/distance": "^3.0.5",
47
+ "@thi.ng/k-means": "^2.0.3",
48
+ "@thi.ng/strings": "^3.9.17",
49
+ "@thi.ng/transducers": "^9.6.2",
50
+ "@thi.ng/vectors": "^8.3.4"
51
51
  },
52
52
  "devDependencies": {
53
- "esbuild": "^0.25.6",
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": "9ec4a5584ed6e59f2b74f4ca9726daef7e766974\n"
144
+ "gitHead": "3cd1bea8b2bf6b859609f6d5c14b4eb64745681f\n"
145
145
  }