@thi.ng/text-analysis 0.4.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-06-18T12:01:21Z
3
+ - **Last updated**: 2025-06-24T21:39:38Z
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.
package/cluster.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { argSort } from "@thi.ng/arrays/arg-sort";
2
- import { lookup } from "@thi.ng/arrays/lookup";
2
+ import { lookup, lookupUnsafe } from "@thi.ng/arrays/lookup";
3
3
  import { knearest as $knearest } from "@thi.ng/distance/knearest";
4
4
  import { Untransformed } from "@thi.ng/distance/untransformed";
5
5
  import { kmeans } from "@thi.ng/k-means";
@@ -13,7 +13,7 @@ import { toDense } from "./vec.js";
13
13
  const JACCARD_DIST_DENSE = new Untransformed(distJaccard);
14
14
  const kmeansDense = (k, docs, opts) => kmeans(k, docs, { maxIter: 100, ...opts }).map((cluster) => ({
15
15
  ...cluster,
16
- docs: lookup(docs, cluster.items)
16
+ docs: lookupUnsafe(docs, cluster.items)
17
17
  }));
18
18
  const kmeansSparse = (k, docs, opts) => kmeansDense(
19
19
  k,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/text-analysis",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
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",
@@ -40,13 +40,13 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@thi.ng/api": "^8.11.29",
43
- "@thi.ng/arrays": "^2.13.0",
43
+ "@thi.ng/arrays": "^2.13.1",
44
44
  "@thi.ng/bidir-index": "^1.3.0",
45
45
  "@thi.ng/checks": "^3.7.9",
46
- "@thi.ng/distance": "^3.0.1",
47
- "@thi.ng/k-means": "^1.1.1",
46
+ "@thi.ng/distance": "^3.0.2",
47
+ "@thi.ng/k-means": "^2.0.0",
48
48
  "@thi.ng/strings": "^3.9.15",
49
- "@thi.ng/transducers": "^9.4.2",
49
+ "@thi.ng/transducers": "^9.5.0",
50
50
  "@thi.ng/vectors": "^8.3.1"
51
51
  },
52
52
  "devDependencies": {
@@ -141,5 +141,5 @@
141
141
  "status": "alpha",
142
142
  "year": 2021
143
143
  },
144
- "gitHead": "b076434a497b291ad33e81b1a15f6a71e2c82cc2\n"
144
+ "gitHead": "e657c2d66574c18343a6797aef4585945729093e\n"
145
145
  }