{
    "mode": "perldoc",
    "parameter": "Lingua::Stem::En",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Lingua%3A%3AStem%3A%3AEn/json",
    "generated": "2026-10-04T08:44:26Z",
    "synopsis": "use Lingua::Stem::En;\nmy $stems   = Lingua::Stem::En::stem({ -words => $wordlistreference,\n-locale => 'en',\n-exceptions => $exceptionshash,\n});",
    "sections": {
        "NAME": {
            "content": "Lingua::Stem::En - Porter's stemming algorithm for 'generic' English\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Lingua::Stem::En;\nmy $stems   = Lingua::Stem::En::stem({ -words => $wordlistreference,\n-locale => 'en',\n-exceptions => $exceptionshash,\n});\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This routine applies the Porter Stemming Algorithm to its parameters, returning the stemmed\nwords.\n\nIt is derived from the C program \"stemmer.c\" as found in freewais and elsewhere, which contains\nthese notes:\n\nPurpose:    Implementation of the Porter stemming algorithm documented\nin: Porter, M.F., \"An Algorithm For Suffix Stripping,\"\nProgram 14 (3), July 1980, pp. 130-137.\nProvenance: Written by B. Frakes and C. Cox, 1986.\n\nI have re-interpreted areas that use Frakes and Cox's \"WordSize\" function. My version may\nmisbehave on short words starting with \"y\", but I can't think of any examples.\n\nThe step numbers correspond to Frakes and Cox, and are probably in Porter's article (which I've\nnot seen). Porter's algorithm still has rough spots (e.g current/currency, -ings words), which\nI've not attempted to cure, although I have added support for the British -ise suffix.\n",
            "subsections": []
        },
        "CHANGES": {
            "content": "1999.06.15 - Changed to '.pm' module, moved into Lingua::Stem namespace,\noptionalized the export of the 'stem' routine\ninto the caller's namespace, added named parameters\n\n1999.06.24 - Switch core implementation of the Porter stemmer to\nthe one written by Jim Richardson <jimr@maths.usyd.edu.au>\n\n2000.08.25 - 2.11 Added stemming cache\n\n2000.09.14 - 2.12 Fixed *major* :( implementation error of Porter's algorithm\nError was entirely my fault - I completely forgot to include\nrule sets 2,3, and 4 starting with Lingua::Stem 0.30.\n-- Jerilyn Franz\n\n2003.09.28 - 2.13 Corrected documentation error pointed out by Simon Cozens.\n\n2005.11.20 - 2.14 Changed rule declarations to conform to Perl style convention\nfor 'private' subroutines. Changed Exporter invokation to more\nportable 'require' vice 'use'.\n\n2006.02.14 - 2.15 Added ability to pass word list by 'handle' for in-place stemming.\n\n2009.07.27 - 2.16 Documentation Fix\n\n2020.06.20 - 2.30 Version renumber for module consistency.\n\n2020.09.26 - 2.31 Fix for Latin1/UTF8 issue in documentation\n",
            "subsections": []
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "stem",
                    "content": "Stems a list of passed words using the rules of US English. Returns an anonymous array\nreference to the stemmed words.\n\nExample:\n\nmy @words         = ( 'wordy', 'another' );\nmy $stemmedwords = Lingua::Stem::En::stem({ -words => \\@words,\n-locale => 'en',\n-exceptions => \\%exceptions,\n});\n\nIf the first element of @words is a list reference, then the stemming is performed 'in\nplace' on that list (modifying the passed list directly instead of copying it to a new\narray).\n\nThis is only useful if you do not need to keep the original list. If you do need to keep the\noriginal list, use the normal semantic of having 'stem' return a new list instead - that is\nfaster than making your own copy and using the 'in place' semantics since the primary\ndifference between 'in place' and 'by value' stemming is the creation of a copy of the\noriginal list. If you don't need the original list, then the 'in place' stemming is about\n60% faster.\n\nExample of 'in place' stemming:\n\nmy $words         = [ 'wordy', 'another' ];\nmy $stemmedwords = Lingua::Stem::En::stem({ -words => [$words],\n-locale => 'en',\n-exceptions => \\%exceptions,\n});\n\nThe 'in place' mode returns a reference to the original list with the words stemmed.\n"
                },
                {
                    "name": "stem_caching",
                    "content": "Sets the level of stem caching.\n\n'0' means 'no caching'. This is the default level.\n\n'1' means 'cache per run'. This caches stemming results during a single call to 'stem'.\n\n'2' means 'cache indefinitely'. This caches stemming results until either the process exits\nor the 'clearstemcache' method is called.\n\nclearstemcache;\nClears the cache of stemmed words\n"
                }
            ]
        },
        "NOTES": {
            "content": "This code is almost entirely derived from the Porter 2.1 module written by Jim Richardson.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Lingua::Stem\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Jim Richardson, University of Sydney\njimr@maths.usyd.edu.au or http://www.maths.usyd.edu.au:8000/jimr.html\n\nIntegration in Lingua::Stem by\nJerilyn Franz, FreeRun Technologies,\n<cpan@jerilyn.info>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Jim Richardson, University of Sydney Jerilyn Franz, FreeRun Technologies\n\nThis code is freely available under the same terms as Perl.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "",
            "subsections": []
        },
        "TODO": {
            "content": "",
            "subsections": []
        }
    },
    "summary": "Lingua::Stem::En - Porter's stemming algorithm for 'generic' English",
    "flags": [],
    "examples": [],
    "see_also": []
}