<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>lang.porter module — Whoosh 2.5.1 documentation</title> <link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '2.5.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <link rel="top" title="Whoosh 2.5.1 documentation" href="../../index.html" /> <link rel="up" title="Whoosh API" href="../api.html" /> <link rel="next" title="lang.wordnet module" href="wordnet.html" /> <link rel="prev" title="lang.morph_en module" href="morph_en.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="wordnet.html" title="lang.wordnet module" accesskey="N">next</a> |</li> <li class="right" > <a href="morph_en.html" title="lang.morph_en module" accesskey="P">previous</a> |</li> <li><a href="../../index.html">Whoosh 2.5.1 documentation</a> »</li> <li><a href="../api.html" accesskey="U">Whoosh API</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-whoosh.lang.porter"> <span id="lang-porter-module"></span><h1><tt class="docutils literal"><span class="pre">lang.porter</span></tt> module<a class="headerlink" href="#module-whoosh.lang.porter" title="Permalink to this headline">¶</a></h1> <p>Reimplementation of the <a class="reference external" href="http://tartarus.org/~martin/PorterStemmer/">Porter stemming algorithm</a> in Python.</p> <p>In my quick tests, this implementation about 3.5 times faster than the seriously weird Python linked from the official page.</p> <dl class="function"> <dt id="whoosh.lang.porter.stem"> <tt class="descclassname">whoosh.lang.porter.</tt><tt class="descname">stem</tt><big>(</big><em>w</em><big>)</big><a class="headerlink" href="#whoosh.lang.porter.stem" title="Permalink to this definition">¶</a></dt> <dd><p>Uses the Porter stemming algorithm to remove suffixes from English words.</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">stem</span><span class="p">(</span><span class="s">"fundamentally"</span><span class="p">)</span> <span class="go">"fundament"</span> </pre></div> </div> </dd></dl> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="morph_en.html" title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">lang.morph_en</span></tt> module</a></p> <h4>Next topic</h4> <p class="topless"><a href="wordnet.html" title="next chapter"><tt class="docutils literal"><span class="pre">lang.wordnet</span></tt> module</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/api/lang/porter.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="wordnet.html" title="lang.wordnet module" >next</a> |</li> <li class="right" > <a href="morph_en.html" title="lang.morph_en module" >previous</a> |</li> <li><a href="../../index.html">Whoosh 2.5.1 documentation</a> »</li> <li><a href="../api.html" >Whoosh API</a> »</li> </ul> </div> <div class="footer"> © Copyright 2007-2012 Matt Chaput. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>