\JLanguageStemmerPorteren
Porter English stemmer class.
This class was adapted from one written by Richard Heyes.
See copyright and link information above.
Synopsis
class JLanguageStemmerPorteren
extends JLanguageStemmer
{
- // members
- private $_regex_consonant;
- private $_regex_vowel;
- // Inherited members from JLanguageStemmer
- protected $cache;
- protected $instances;
- // methods
- public string stem()
- private static string _step1ab()
- private static string _step1c()
- private static string _step2()
- private static string _step3()
- private static string _step4()
- private static string _step5()
- private static boolean _replace()
- private static integer _m()
- private static boolean _doubleConsonant()
- private static boolean _cvc()
- // Inherited methods from JLanguageStemmer
- public static JLanguageStemmer getInstance()
- public abstract string stem()
Hierarchy
Extends
Members
private
- $_regex_consonant
—
string
Regex for matching a consonant. - $_regex_vowel
—
string
Regex for matching a vowel
protected
- $cache
—
array
An internal cache of stemmed tokens. - $instances — array
Methods
private
- _cvc() — Checks for ending CVC sequence where second C is not W, X or Y
- _doubleConsonant() — Returns true/false as to whether the given string contains two of the same consonant next to each other at the end of the string.
- _m() — m() measures the number of consonant sequences in $str. if c is a consonant sequence and v a vowel sequence, and <..> indicates arbitrary presence,
- _replace() — Replaces the first string with the second, at the end of the string. If third arg is given, then the preceding string must match that m count at least.
- _step1ab() — Step 1
- _step1c() — Step 1c
- _step2() — Step 2
- _step3() — Step 3
- _step4() — Step 4
- _step5() — Step 5
public
- stem() — Method to stem a token and return the root.
Inherited from JLanguageStemmer
public
- getInstance() — Method to get a stemmer, creating it if necessary.
- stem() — Method to stem a token and return the root.