docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Built-in Split Chinese Characters

Open taozhiyu opened this issue 1 year ago • 2 comments

As code here:

https://github.com/easyops-cn/docusaurus-search-local/blob/86561f6dc2549da9d65bacbfcc05a379f886757a/docusaurus-search-local/src/shared/lunrLanguageZh.ts#L29-L32

when I tried to define "涛之雨" as a phrases, it will not work, cause "之" will be removed, and it comes to "涛雨" (and finally split into "涛" and "雨").

The lucky in misfortune is that when searching "涛之雨" it will still work cause when searching "涛之雨", it will match "涛??雨", and works as well.

taozhiyu avatar Dec 21 '23 02:12 taozhiyu

Try this option zhUserDict, E.g.:

zhUserDict: "涛之雨\n云之南"
image

weareoutman avatar Dec 21 '23 03:12 weareoutman

Try this option zhUserDict, E.g.:

zhUserDict: "涛之雨\n云之南"
image

~~Unfortunately, that doesn't work.In the code shown above, “之” will be removed.~~

Fine, I'll retry the zhUserDict instead of zhUserDictPath, I'm not sure is there any difference between them.

taozhiyu avatar Dec 21 '23 05:12 taozhiyu