Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Signed-off-by: 蒋小霕 <[email protected]>
  • Loading branch information
holton-jiang authored Nov 1, 2023
1 parent 92a94a5 commit 74c92fa
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { defineConfig } from 'vite'
// import { SearchPlugin } from 'vitepress-plugin-search'
// import Segment from 'segment' // 中文分词器
// // import flexSearchIndexOptions from 'flexsearch'
// // 创建实例
// const segment = new Segment()
// // 使用默认的识别模块及字典,载入字典文件需要1秒,仅初始化时执行一次即可
// segment.useDefault()
// // 开始分词
// // console.log(segment.doSegment('这是一个基于Node.js的中文分词模块。'));

// const options = {
// // ...flexSearchIndexOptions,
// // 采用分词器优化,
// encode: function (str) {
// return segment.doSegment(str, { simple: true })
// },
// tokenize: 'forward', // 解决汉字搜索问题。来源:https://github.com/emersonbottero/vitepress-plugin-search/issues/11

// // 以下代码返回完美的结果,但内存与空间消耗巨大,索引文件达到80M+
// // encode: false,
// // tokenize: "full",
// }

export default defineConfig({
// plugins: [
// // SearchPlugin({
// // tokenize: 'full',
// // }),
// SearchPlugin(options),
// ],
})

0 comments on commit 74c92fa

Please sign in to comment.