# man > Lingua::Stem(3pm)

---
type: CommandReference
command: Lingua::Stem
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference
- `stem(@words)` — stem a list of words, returns anonymous array of stems
- `stem_in_place(@words)` — stem in place, modifying the original list (faster, English only)
- `my $stemmer = Lingua::Stem->new(-locale => 'EN-UK')` — OO constructor with locale
- `$stemmer->stem_caching({ -level => 2 })` — enable permanent cache for huge speed gains
- `Lingua::Stem::add_exceptions({ 'emily' => 'emily' })` — override stemming for specific words
- `$stemmer->set_locale('de')` — change locale for an instance
- `$stemmer->clear_stem_cache` — clear the stem cache

## Name
Lingua::Stem — stemming of words

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

# OO interface
use Lingua::Stem;
my $stemmer = Lingua::Stem->new(-locale => 'EN-UK');
$stemmer->stem_caching({ -level => 2 });
my $stemmed = $stemmer->stem(@words);
## Options (Methods)

### Constructor
- `new(-locale => $locale, -default_locale => $locale)` — create a new stemmer instance; sets locale and optionally changes the default locale for all future instances

### Locale Management
- `set_locale($locale)` — instance or class method; sets the stemming locale (e.g., 'en', 'de', 'fr')
- `get_locale` — returns the current default locale (class) or instance locale (instance)

### Exception Handling
- `add_exceptions({ $word => $stem })` — class or instance method; add word‑specific overrides
- `delete_exceptions(@words)` — remove exceptions; call with no arguments to delete all
- `get_exceptions(@words)` — retrieve exceptions; with no arguments returns all, with arguments returns specific ones

### Stemming
- `stem(@words)` — class or instance method; returns an anonymous array of stemmed words in the same order as input; respects locale and exceptions
- `stem_in_place(@words)` — stems the list in place, returning a reference to the modified list; currently only for English locales; about 60% faster than `stem`

### Caching
- `stem_caching({ -level => 0|1|2 })` — class or instance method; level 0 = no caching (default), 1 = cache per `stem` call, 2 = cache indefinitely until process exit or `clear_stem_cache`
- `clear_stem_cache` — clears the stem cache for the current locale

## Examples
perl
# Basic stemming
use Lingua::Stem;
my @words = qw(running runner runs);
my $stems = Lingua::Stem::stem(@words);
# returns ["run","runner","run"]

# OO with caching and exception
my $stemmer = Lingua::Stem->new(-locale => 'en');
$stemmer->stem_caching({ -level => 2 });
$stemmer->add_exceptions({ 'skies' => 'sky' });
my $results = $stemmer->stem(qw(skies clouds));
# returns ["sky","cloud"]

# In-place stemming (modifies original array)
my @data = ('jumping', 'quickly', 'foxes');
my $ref = stem_in_place(@data);
# @data now contains ["jump","quickli","fox"]
## See Also
- [Lingua::Stem::En](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AEn/markdown)
- [Lingua::Stem::Snowball](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASnowball/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::Fr](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AFr/markdown)
- [Lingua::Stem::It](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AIt/markdown)
- [Lingua::Stem::Pt](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3APt/markdown)
- [Lingua::Stem::Ru](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ARu/markdown)
- [Lingua::Stem::Sv](http://localhost/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3ASv/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)
- [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)
- Snowball project: [http://snowball.tartarus.org](http://snowball.tartarus.org)