Git Product home page Git Product logo

Comments (2)

olivernn avatar olivernn commented on July 20, 2024

I think the problem is that the Japanese language plugin must provide its own tokenizer, due to the extra work required for correctly tokenising Japanese text. This means it isn't recording the same metadata that the built in tokeniser does.

Here is how it is done in Lunr - https://github.com/olivernn/lunr.js/blob/master/lib/tokenizer.js#L41-L46
And here is the tokeniser in the Japanese adaptor - https://github.com/MihaiValentin/lunr-languages/blob/master/lunr.ja.js#L105

So you would have to understand how to get positions out of tool being used to segment the Japanese text, I'm not familiar with that library so unable to say how easy that would be, but adding them to the index is just a matter of passing the details to the lunr.Token constructor

from lunr-languages.

danjarvis avatar danjarvis commented on July 20, 2024

Hey @olivernn!

I was just looking through the JA plugin for lunr-languages and after comparing it with the base tokenizer code for EN it seems pretty straightforward to attach the position metadata for Japanese. I'm going to try and work through it tomorrow and I'll update this issue accordingly.

Thank you for all your work on lunr!

from lunr-languages.

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.