0.0.4 • Published 3 years ago

lunr-no v0.0.4

Weekly downloads
-
License
MPL-1.1
Repository
github
Last release
3 years ago

Norwegian lunr

lunr-no features a Norwegian trimmer, language stemmer and stopword filter for Lunr.js (a js full text search engine).

How to use

lunr-no supports AMD and CommonJS. Check out the examples below:

In a web browser

Add the following JS files to the page:

<script src="lunr.stemmer.support.js"></script>
<script src="lunr.no.js"></script>

then, use the language in when initializing lunr:

var index = lunr(function () {
    // use the language
    this.use(lunr.no);
    // then, the normal lunr index initialization
    this.field('title', { boost: 10 });
    this.field('body');
});

That's it. Just add the documents and you're done.

With node.js (or with browserify)

var lunr = require('lunr');
require('lunr-no/lunr.stemmer.support.js')(lunr);
require('lunr-no')(lunr);

var index = lunr(function () {
    // use the language
    this.use(lunr.no);
    // then, the normal lunr index initialization
    this.field('title', { boost: 10 })
    this.field('body')
});

Building your own files

See lunr-languages.

Technical details & Credits

This is a fork of lunr-languages. The code is identical, except the added trimmer.

0.0.4

3 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago