core: remove @orama/stopwords

This commit is contained in:
Abdullah Atta
2025-05-06 10:32:16 +05:00
parent 90900628a2
commit 62b5cc853b
4 changed files with 2 additions and 15 deletions

View File

@@ -13,7 +13,6 @@
"@leeoniya/ufuzzy": "^1.0.10",
"@microsoft/signalr": "^8.0.0",
"@notesnook/logger": "file:../logger",
"@orama/stopwords": "^3.1.6",
"@readme/data-urls": "^3.0.0",
"@streetwriters/kysely": "^0.27.4",
"@streetwriters/showdown": "^3.0.9-alpha",
@@ -1478,15 +1477,6 @@
"resolved": "../logger",
"link": true
},
"node_modules/@orama/stopwords": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/@orama/stopwords/-/stopwords-3.1.6.tgz",
"integrity": "sha512-m25K03OR8/kfr63mr+SAQJIKSHY5K63kFvRwBovORc2LkrdQxjrSwDNuQUV40obII30mwL3Kv+KoBYYDQJ6FxA==",
"license": "Apache-2.0",
"engines": {
"node": ">= 16.0.0"
}
},
"node_modules/@otplib/core": {
"version": "12.0.1",
"dev": true,

View File

@@ -67,7 +67,6 @@
"@leeoniya/ufuzzy": "^1.0.10",
"@microsoft/signalr": "^8.0.0",
"@notesnook/logger": "file:../logger",
"@orama/stopwords": "^3.1.6",
"@readme/data-urls": "^3.0.0",
"@streetwriters/kysely": "^0.27.4",
"@streetwriters/showdown": "^3.0.9-alpha",

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { match, surround } from "fuzzyjs";
import { match } from "fuzzyjs";
import Database from "./index.js";
import {
Item,

View File

@@ -17,8 +17,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { stopwords } from "@orama/stopwords";
type ASTNode = QueryNode | PhraseNode | OperatorNode;
type QueryNode = {
@@ -163,7 +161,7 @@ function generateSQL(ast: QueryNode): string {
}
export function transformQuery(query: string) {
const tokens = tokenize(query).filter((token) => !stopwords.includes(token));
const tokens = tokenize(query);
const largeTokens = tokens.filter((token) => token.length >= 3);
return {
query: generateSQL(transformAST(parseTokens(largeTokens))),