Porteren

Extends \Joomla\CMS\Language\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

Methods

_cvc

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

_cvc(string $str) : boolean
static
since

3.0.0

Arguments

$str

stringString to check

Response

booleanResult

_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) : boolean
static
since

3.0.0

Arguments

$str

stringString to check

Response

booleanResult

_m

m() measures the number of consonant sequences in $str. if c is a consonant sequence and v a vowel sequence, and <.

_m(string $str) : integer
static

.> indicates arbitrary presence,

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

integerThe 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( &$str, string $check, string $repl, integer $m = null) : boolean
static
since

3.0.0

Arguments

$str

$check

stringEnding to check for

$repl

stringReplacement string

$m

integerOptional minimum number of m() to meet

Response

booleanWhether 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