# perldoc > Lingua::Stem

---
type: CommandReference
command: Lingua::Stem
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference
- `use Lingua::Stem qw(stem); my $stemmed = stem(@words);` — functional interface
- `my $stemmer = Lingua::Stem->new(-locale => 'EN-UK');` — OO with locale
- `$stemmer->stem_caching({ -level => 2 });` — enable indefinite caching
- `$stemmer->add_exceptions({ 'driven' => 'driven' });` — override stemming
- `stem_in_place(@words);` — fast in-place stemming (English only)
- `set_locale('en-uk');` — change default locale
- `clear_stem_cache;` — clear the stemming cache
- `get_locale;` — return current locale

## Name
Stemming of words

## Synopsis
perl
use Lingua::Stem qw(stem);
my $stemmed = stem(@words);

# OO style
use Lingua::Stem;
my $stemmer = Lingua::Stem->new(-locale => 'EN-UK');
$stemmer->stem_caching({ -level => 2 });
my $stemmed = $stemmer->stem(@words);
## Options
All methods can be called as class or instance methods unless noted.

### Core stemming
- `stem(@words)` — returns array ref of stemmed words
- `stem_in_place(@words)` — modifies list in place, returns ref; ~60% faster, English only

### Caching
- `stem_caching({ -level => 0|1|2 })` — set cache level (0 = none, 1 = per call, 2 = permanent)
- `clear_stem_cache` — clear cache for current locale

### Locale
- `set_locale($locale)` — set locale (e.g., 'en', 'en-uk', 'de', 'fr', 'ru')
- `get_locale` — return current locale string

### Exceptions
- `add_exceptions({ word => replacement, ... })` — override stemming for exact matches
- `delete_exceptions(@words)` — remove exceptions; no args removes all
- `get_exceptions(@words)` — return hash ref of exceptions; no args returns all

Supported locales: DA, DE, EN (EN-US, EN-UK), FR, GL, IT, NO, PT, RU (RU-RU, RU-RU.KOI8-R), SV.

## Examples
perl
# Basic functional usage
use Lingua::Stem qw(stem);
my @words = ('running', 'jumps', 'easily');
my $stemmed = stem(@words);
# $stemmed = ['run', 'jump', 'easili']

# OO with caching and exceptions
my $stemmer = Lingua::Stem->new(-locale => 'en');
$stemmer->stem_caching({ -level => 2 });
$stemmer->add_exceptions({ 'mice' => 'mouse' });
my $words = $stemmer->stem('mice', 'running');
# $words = ['mouse', 'run']

# Changing locale and clearing cache
Lingua::Stem::set_locale('de');
clear_stem_cache;
## See Also
[Lingua::Stem::En](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AEn/markdown), [Lingua::Stem::Da](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ADa/markdown), [Lingua::Stem::De](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ADe/markdown), [Lingua::Stem::Gl](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AGl/markdown), [Lingua::Stem::No](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ANo/markdown), [Lingua::Stem::Pt](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3APt/markdown), [Lingua::Stem::Sv](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASv/markdown), [Lingua::Stem::It](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AIt/markdown), [Lingua::Stem::Fr](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AFr/markdown), [Lingua::Stem::Ru](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ARu/markdown), [Text::German](http://localhost/phpMan.php/perldoc/Text%3A%3AGerman/markdown), [Lingua::PT::Stemmer](http://localhost/phpMan.php/perldoc/Lingua%3A%3APT%3A%3AStemmer/markdown), [Lingua::GL::Stemmer](http://localhost/phpMan.php/perldoc/Lingua%3A%3AGL%3A%3AStemmer/markdown), [Lingua::Stem::Snowball::No](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball%3A%3ANo/markdown), [Lingua::Stem::Snowball::Se](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball%3A%3ASe/markdown), [Lingua::Stem::Snowball::Da](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball%3A%3ADa/markdown), [Lingua::Stem::Snowball::Sv](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball%3A%3ASv/markdown), [Lingua::Stemmer::GL](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStemmer%3A%3AGL/markdown), [Lingua::Stem::Snowball](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball/markdown)