remove the nodejs-jieba

This commit is contained in:
PrinOrange
2024-01-06 12:01:04 +08:00
parent 623c0f3b0b
commit 8db176fae9
3 changed files with 18 additions and 794 deletions

View File

@@ -1,14 +1,13 @@
import minisearch from "minisearch";
import { cutForSearch } from "nodejs-jieba";
// import { cutForSearch } from "nodejs-jieba";
import { getPostFileContent, sortedPosts } from "./post-process";
// TODO: The jieba tokenizer seems not be supported by vercel platform
// that causes the module loading error.
// So here is the remain task for seeking better Chinese tokenizer.
function tokenizer(str: string) {
return cutForSearch(str, true);
}
// that causes the module loading error.
// So here is the remain task for seeking better Chinese tokenizer.
// function tokenizer(str: string) {
// return cutForSearch(str, true);
// }
function makeSearchIndex() {
let miniSearch = new minisearch({