Code Monkey home page Code Monkey logo

Comments (3)

weixsong avatar weixsong commented on July 17, 2024 1

Hi, @lierisme , if you want to support Chinese, you just need to update the tokenizer, you could find a Chinese tokenizer, or, you could just tokenize Chinese by each word.
Chinese tokenizer is a complex package, so if you want to support a good chinese tokenizer, I think elasticlunr.js should not be run in browser

from elasticlunr.js.

caihaibin1991 avatar caihaibin1991 commented on July 17, 2024

I replace the default to use jieba, but I do not why "Pipeline" return a empty array.
image

from elasticlunr.js.

hepezu avatar hepezu commented on July 17, 2024

@caihaibin1991

For supporting Chinese ,

  1. Change tokenizer or do tokenization before elasticlunr's default tokenizer. For example, "能够支持中文吗"->"能够 支持 中文 吗", after this preprocessing, the default tokenizer can work by split space. For tokenization, nodejieba, @node-rs/jieba or regex to split every character can be used.

  2. [Your issue] Remove default elasticlunr.trimmer, by index.pipeline.remove(elasticlunr.trimmer). The default trimmer trims all non-english characters, which results your issue.

  3. Further work. Make your own pipeline to process text, including tokenizer, trimmer, stemmer and stopword filter. Examples are in weixsong/lunr-languages.

from elasticlunr.js.

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.