An open API service indexing awesome lists of open source software.

https://github.com/tomsquest/lucene-stemmers

Stem words like Lucene (port of Lucene' stemmers to JavaScript)
https://github.com/tomsquest/lucene-stemmers

lucene stem stemmer stemming

Last synced: 9 days ago
JSON representation

Stem words like Lucene (port of Lucene' stemmers to JavaScript)

Awesome Lists containing this project

README

        

# Lucene Stemmers in JavaScript

Lucene Stemmers Logo

[![Version](https://img.shields.io/npm/v/lucene-stemmers.svg?style=for-the-badge)](https://www.npmjs.com/package/lucene-stemmers)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/tomsquest/lucene-stemmers/check.yml?style=for-the-badge)](https://github.com/tomsquest/lucene-stemmers/actions/workflows/check.yml)

> **`Lucene Stemmers`** is a port of Lucene's stemmers in JavaScript.

## Table of contents

- [Changelog](#changelog)
- [Install](#install)
- [Usage](#usage)
- [Stemmers implemented](#stemmers-implemented)
- [TODO](#todo)

## Changelog

> See [CHANGELOG.md](CHANGELOG.md)

## Install

```sh
npm install lucene-stemmers
```

## Usage

In plain **JavaScript**:

```js
const { stemFrenchMinimal } = require("lucene-stemmers");

const stemmed = stemFrenchMinimal("chevaux");
// stemmed === "cheval"
```

In **Typescript**:

```ts
import { stemFrenchMinimal } from "lucene-stemmers";

const stemmed = stemFrenchMinimal("chevaux");
// stemmed === "cheval"
```

## Stemmers implemented

These stemmers are available:

- [x] French
- [x] Minimal
- Function: `stemFrenchMinimal`
- [Lucene source code](https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java)
- [x] Light
- Function: `stemFrenchLight`
- [Lucene source code](https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java)
- [x] Italian
- [x] Light
- Function: `stemItalianLight`
- [Lucene source code](https://github.com/apache/lucene/blob/main/lucene/analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemFilter.java)

## TODO

- [ ] Add why
- [ ] Add more stemmers
- [ ] Publish browser version
- [ ] CI