1It(3) User Contributed Perl Documentation It(3)
2
3
4
6 Lingua::Stem::It - Porter's stemming algorithm for Italian
7
9 use Lingua::Stem::It;
10 my $stems = Lingua::Stem::It::stem({ -words => $word_list_reference,
11 -locale => 'it',
12 -exceptions => $exceptions_hash,
13 });
14
15 my $stem = Lingua::Stem::It::stem_word( $word );
16
18 This module applies the Porter Stemming Algorithm to its parameters,
19 returning the stemmed words.
20
21 The algorithm is implemented exactly (I hope :-) as described in:
22
23 http://snowball.tartarus.org/algorithms/italian/stemmer.html
24
25 The code is carefully crafted to work in conjunction with the
26 Lingua::Stem module by Benjamin Franz, from which I've also borrowed
27 some functionalities (caching and exception list).
28
30 stem({ -words => \@words, -locale => 'it', -exceptions => \%exceptions
31 });
32 Stems a list of passed words. Returns an anonymous list reference
33 to the stemmed words.
34
35 Example:
36
37 my $stemmed_words = Lingua::Stem::It::stem({ -words => \@words,
38 -locale => 'it',
39 -exceptions => \%exceptions,
40 });
41
42 stem_word( $word );
43 Stems a single word and returns the stem directly.
44
45 Example:
46
47 my $stem = Lingua::Stem::It::stem_word( $word );
48
49 stem_caching({ -level => 0|1|2 });
50 Sets the level of stem caching.
51
52 '0' means 'no caching'. This is the default level.
53
54 '1' means 'cache per run'. This caches stemming results during a
55 single
56 call to 'stem'.
57
58 '2' means 'cache indefinitely'. This caches stemming results until
59 either the process exits or the 'clear_stem_cache' method is
60 called.
61
62 clear_stem_cache;
63 Clears the cache of stemmed words
64
65 EXPORT
66 None by default.
67
69 Aldo Calpini, dada@perl.it
70
72 Lingua::Stem
73
75 Copyright (c) Aldo Calpini, dada@perl.it. All rights reserved.
76
77 This library is free software; you can redistribute it and/or modify it
78 under the same terms as Perl itself.
79
80
81
82perl v5.38.0 2023-07-20 It(3)