Porteren
Extends LanguageStemmerPorter English stemmer class.
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
| 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
| 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
| 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
| 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
| since |
3.0.0 |
|---|
Arguments
- word
stringThe token to stem.
Response
string
_step1c
Step 1c
_step1c(string word) : string
| since |
3.0.0 |
|---|
Arguments
- word
stringThe token to stem.
Response
string
_step2
Step 2
_step2(string word) : string
| since |
3.0.0 |
|---|
Arguments
- word
stringThe token to stem.
Response
string
_step3
Step 3
_step3(string word) : string
| since |
3.0.0 |
|---|
Arguments
- word
stringThe token to stem.
Response
string
_step4
Step 4
_step4(string word) : string
| since |
3.0.0 |
|---|
Arguments
- word
stringThe token to stem.
Response
string
_step5
Step 5
_step5(string word) : string
| 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
| since |
3.0.0 |
|---|---|
| throws |
|
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
| 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.
| since |
3.0.0 |
|---|
Type(s)
string
_regex_vowel
Regex for matching a vowel
| since |
3.0.0 |
|---|
Type(s)
string
cache
An internal cache of stemmed tokens.
| since |
3.0.0 |
|---|
Type(s)
array
instances
LanguageStemmer instances.
| since |
3.0.0 |
|---|
Type(s)
array