Comments (2)
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.
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)
- Error when initializing `lunr.th.js` HOT 1
- Is this repository dead? HOT 1
- Add language support for Catalan
- How should I use it in ES6?
- lunr.zh.js can`t search 'database' HOT 4
- React JS
- Accented letter ê should be replaced by e in the french stemmer HOT 1
- Usage of Lunr js with Turkish language
- Minified version of the Thai language is missing HOT 2
- lunr-languages/lunr.fr.js fails to find common words like "équipement" HOT 3
- Can "nodejieba" be as "devDependency" or "peerDependency" in lunr-languages? HOT 4
- Update nodejs version in CI
- nodejieba (Chinese) is not working with webpack HOT 1
- lunr.de fails with umlaute in wildcard search
- Arabic HOT 1
- Search indexing for Chinese language (lunr.zh) does not work with multi-language HOT 4
- Idea: Use Intl.Segmenter to reduce bundle size in browsers
- Error when using lunr.zh.js 'nodejieba.cut is not a function' HOT 2
- Cannot read properties of undefined (reading 'registerFunction') HOT 1
- Add language support for Sanskrit, Kannada & Telugu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lunr-languages.