GithubHelp home page GithubHelp logo

Can't search in Chinese. about raneto HOT 13 CLOSED

ryanlelek avatar ryanlelek commented on June 26, 2024
Can't search in Chinese.

from raneto.

Comments (13)

codepiano avatar codepiano commented on June 26, 2024 1

@ryanlelek
Sorry for late, if you want add search support for Chinese, use 'codepiano/lunr.js' replace official lunr.js dependency in module 'rateno-core', not 'rateno' itself, like this:

    "lunr": "codepiano/lunr.js",

It seems fine.

from raneto.

nykma avatar nykma commented on June 26, 2024

Same here. Seems like lunr doesn't support utf-8.

from raneto.

bborysenko avatar bborysenko commented on June 26, 2024

Same for Russian :(

from raneto.

bborysenko avatar bborysenko commented on June 26, 2024

It seems i have found the way how to add support for languages other than English.

For that i have installed the lunr-languages package:

[~/Raneto-0.6.0]$ npm install lunr-languages

And add a few lines to node_modules/raneto-core/raneto.js:

[~/Raneto-0.6.0]$ diff node_modules/raneto-core/raneto.js node_modules/raneto-core/raneto.js.orig
10,11d9
<   require('../lunr-languages/lunr.stemmer.support.js')(lunr);
<   require('../lunr-languages/lunr.ru.js')(lunr);
199d196
<           this.use(lunr.ru);

from raneto.

nykma avatar nykma commented on June 26, 2024

Nice job man!
But still, no Chinese support in lunr-languages :(

from raneto.

bborysenko avatar bborysenko commented on June 26, 2024

Yes really, I have missed that point. Then perhaps you might try to replace default lunr package with that one - https://github.com/codepiano/lunr.js?

from raneto.

in-in avatar in-in commented on June 26, 2024

@bborysenko, дай бог тебе здоровья =)

from raneto.

ryanlelek avatar ryanlelek commented on June 26, 2024

Chinese search support was mentioned in another issue that was closed, so I'll summarize it here.

@vyp said:

For Chinese searching, you will probably have to modify raneto to add support for lunr-languages: olivernn/lunr.js#91 (comment). But as you can see in that link, lunr-languages does not yet support Chinese.

Another potential option would be to try and replace the lunr that Raneto uses with https://github.com/codepiano/lunr.js, which seems like a Chinese version of lunr.js (found with the comment just below the previously linked comment). I haven't used this though, so I'm not sure if this only support Chinese, or supports both English and Chinese.

@codepiano replied:

My fork of lunr supports both English and Chinese.I use it to replace the original lunr repo in gitbook dependencies, and it works well.
...
I'll test whether it works well in Raneto when I have time. Raneto is a nice tool.

Looping you all in via mention so we can restart this and get a solution.
@LuxuryZhou, @shuhankuang, @nykma, @OneManOpsTeam, @in-in

from raneto.

codepiano avatar codepiano commented on June 26, 2024

Gitbook use lunr.js to build search index from original markdown files, store the index in a file,and load this file in web page.
If Raneto also uses lunr.js this way,maybe my fork version will also work.

from raneto.

ZhangTongLe avatar ZhangTongLe commented on June 26, 2024

@codepiano 我按照您的方案配置了lunr.js 和Raneto,nodejieba 也安装好了,但是搜索中文的时候,还是不能搜索中文,不造啥原因~,大神能帮忙集成一下,十分感谢~!

from raneto.

ZhangTongLe avatar ZhangTongLe commented on June 26, 2024

@codepiano @ryanlelek Thank OF provide such a good tool, replaced by the support of the Chinese lunr.js codepiano has successfully support Chinese search

from raneto.

ryanlelek avatar ryanlelek commented on June 26, 2024

Fixed in #246 by @Orhideous

from raneto.

chinayangh avatar chinayangh commented on June 26, 2024

@ZhangTongLe can you post step by step details about how to config Raneto to support Chinese keywords search ? Any help from you will be greatly appreciated.

from raneto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.