Skip to content

Commit

Permalink
last touches
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Nov 20, 2023
1 parent 241a0b1 commit 5b4ba99
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/facets/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stereobooster/facets",
"version": "0.1.0",
"description": "",
"description": "Client-side (though you can run it on the server) faceted search engine",
"keywords": ["faceted", "search", "search-engine", "fulltext", "browser", "client-side"],
"author": "stereobooster",
"license": "MIT",
Expand Down Expand Up @@ -30,7 +30,6 @@
"tsc": "tsc"
},
"dependencies": {
"mnemonist": "^0.39.5",
"typedfastbitset": "^0.4.2"
},
"peerDependencies": {
Expand All @@ -41,6 +40,7 @@
"quick-score": "^0.2.0"
},
"devDependencies": {
"mnemonist": "^0.39.5",
"flexsearch": "^0.7.31",
"fuse.js": "^7.0.0",
"minisearch": "^6.2.0",
Expand Down
30 changes: 15 additions & 15 deletions packages/facets/src/ITrieMapIndex.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import TrieMap from "mnemonist/trie-map.js";
import { SparseTypedFastBitSet } from "typedfastbitset";
import { InvertedIndexMaplike } from "./InvertedIndex";
// import TrieMap from "mnemonist/trie-map.js";
// import { SparseTypedFastBitSet } from "typedfastbitset";
// import { InvertedIndexMaplike } from "./InvertedIndex";

export class ITrieMapIndex<K> extends InvertedIndexMaplike<K> {
index: TrieMap<K, SparseTypedFastBitSet>;
// export class ITrieMapIndex<K> extends InvertedIndexMaplike<K> {
// index: TrieMap<K, SparseTypedFastBitSet>;

constructor() {
super();
this.index = new TrieMap();
}
// constructor() {
// super();
// this.index = new TrieMap();
// }

like(prefix: K) {
return this.index
.find(prefix)
.reduce((p, [_, v]) => p.union(v), new SparseTypedFastBitSet());
}
}
// like(prefix: K) {
// return this.index
// .find(prefix)
// .reduce((p, [_, v]) => p.union(v), new SparseTypedFastBitSet());
// }
// }
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b4ba99

Please sign in to comment.