# Stemerge
[](https://hex.pm/packages/stemerge)
[](https://github.com/donderom/stemerge/actions/workflows/main.yml)
[](https://github.com/donderom/stemerge/blob/main/LICENSE)
[](https://www.erlang.org)
Stemerge is a collection of [stemmers](http://en.wikipedia.org/wiki/Stemming) in Erlang.
## Supported languages
At the moment, the following languages are supported:
* English (Porter2 stemming algorithm)
* Finnish
Romance:
* French
* Italian
* Portuguese
* Spanish
Germanic:
* Dutch
* German
Scandinavian:
* Danish
* Norwegian
* Swedish
## Usage
### Erlang
Add `stemerge` as a dependency to the `rebar.config`:
```erlang
{deps, [
{"stemerge", "0.4.0"}
]}.
```
Specify the language code of the word you'd like to stem, like this:
```erlang
stemerge:stem("stemerge", "en")
```
or call the `stem/1` API of any available stemmer separately:
```erlang
stemerge_no:stem("havneeier")
```
### Elixir
Add `stemerge` as a dependency to the `mix.exs`:
```elixir
defp deps do
[
{:stemerge, "0.4.0"}
]
end
```
Call the Erlang API from Elixir:
```elixir
:stemerge.stem("stemming", "en")
```
### Gleam
Add `stemerge` as a dependency to the `gleam.toml`:
```toml
[dependencies]
stemerge = "0.4.0"
```
Define an external function:
```gleam
@external(erlang, "stemerge", "stem")
pub fn stem(s: String, lang: String) -> String
```
Call the external function from Gleam:
```gleam
stem("stemming", "en")
```