Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I apply the word split function to the CJK text in search box? #65

Open
arcqiufeng opened this issue Mar 10, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@arcqiufeng
Copy link

arcqiufeng commented Mar 10, 2023

We don't split words by space in CJK Language. There is no simple way to split a CJK sentence into words.

I found a module "segment" can do this job. Now it is works partly: See #64

If I type the keyword: 设计责任 in search box, found nothing.

If I type the keyword: 设计 责任 in search box, found the result.

I think it is because of 设计责任 is not a single word but two words. It should be split into two words then passed to search box.

Can I split it into two words automatically (using the module segment)?

@emersonbottero
Copy link
Owner

#11

@arcqiufeng
Copy link
Author

arcqiufeng commented Mar 13, 2023

#11

No. That's not my problem.

It is no problem to use this word splitter for the text and then generate the index. This problem has been solved according to the link you said. I also participated in the discussion in that link. This word splitter works well for text segmentation. It has basically been able to meet the demand.

Now my problem is that I want to apply this word splitter in the search box. Only when word segmentation is also carried out in the search box, can we get more correct results. If I need to get the right search results, I have to manually break the words in the search box.

@emersonbottero
Copy link
Owner

Gotcha. I'll have to expose a callback called on text input.
I think it is possible.

@emersonbottero emersonbottero added the enhancement New feature or request label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants