Porteren

Extends LanguageStemmer

Porter English stemmer class.

deprecated

This class was adapted from one written by Richard Heyes. See copyright and link information above.

since

3.0.0

deprecated

4.0 Use wamania/php-stemmer

package

Joomla CMS

Methods

_cvc

Checks for ending CVC sequence where second C is not W, X or Y

_cvc(string str) : bool
static
since

3.0.0

Arguments

str

stringString to check

Response

boolResult

_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.

_doubleConsonant(string str) : bool
static
since

3.0.0

Arguments

str

stringString to check

Response

boolResult

_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,

_m(string str) : int
static

gives 0 vc gives 1 vcvc gives 2 vcvcvc gives 3

since

3.0.0

Arguments

str

stringThe string to return the m count for

Response

intThe m count

_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.

_replace(string &str, string check, string repl, int m = null) : bool
static
since

3.0.0

Arguments

str

stringString to check

check

stringEnding to check for

repl

stringReplacement string

m

intOptional minimum number of m() to meet

Response

boolWhether the $check string was at the end of the $str string. True does not necessarily mean that it was replaced.

_step1ab

Step 1

_step1ab(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

_step1c

Step 1c

_step1c(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

_step2

Step 2

_step2(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

_step3

Step 3

_step3(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

_step4

Step 4

_step4(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

_step5

Step 5

_step5(string word) : string
static
since

3.0.0

Arguments

word

stringThe token to stem.

Response

string

getInstance

Method to get a stemmer, creating it if necessary.

getInstance(string adapter) : \Joomla\CMS\Language\LanguageStemmer
inherited static
since

3.0.0

throws

\RuntimeExceptionon invalid stemmer.

Arguments

adapter

stringThe type of stemmer to load.

Response

\Joomla\CMS\Language\LanguageStemmerA LanguageStemmer instance.

stem

Method to stem a token and return the root.

stem(string token, string lang) : string
inherited abstract
since

3.0.0

Arguments

token

stringThe token to stem.

lang

stringThe language of the token.

Response

stringThe root token.

Properties

_regex_consonant

Regex for matching a consonant.

static
since

3.0.0

Type(s)

string

_regex_vowel

Regex for matching a vowel

static
since

3.0.0

Type(s)

string

cache

An internal cache of stemmed tokens.

inherited
since

3.0.0

Type(s)

array

instances

LanguageStemmer instances.

inherited static
since

3.0.0

Type(s)

array