Porteren
Extends \Joomla\CMS\Language\LanguageStemmerPorter English stemmer class.
This class was adapted from one written by Richard Heyes. See copyright and link information above.
since |
3.0.0 |
---|
Methods
_cvc
Checks for ending CVC sequence where second C is not W, X or Y
_cvc(string $str) : boolean
since |
3.0.0 |
---|
Arguments
- $str
string
String to check
Response
boolean
Result
_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
since |
3.0.0 |
---|
Arguments
- $str
string
String to check
Response
boolean
Result
_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
.> indicates arbitrary presence,
since |
3.0.0 |
---|
Arguments
- $str
string
The string to return the m count for
Response
integer
The 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
since |
3.0.0 |
---|
Arguments
- $str
- $check
string
Ending to check for- $repl
string
Replacement string- $m
integer
Optional minimum number of m() to meet
Response
boolean
Whether 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
string
The token to stem.
Response
string
_step1c
Step 1c
_step1c(string $word) : string
since |
3.0.0 |
---|
Arguments
- $word
string
The token to stem.
Response
string
_step2
Step 2
_step2(string $word) : string
since |
3.0.0 |
---|
Arguments
- $word
string
The token to stem.
Response
string
_step3
Step 3
_step3(string $word) : string
since |
3.0.0 |
---|
Arguments
- $word
string
The token to stem.
Response
string
_step4
Step 4
_step4(string $word) : string
since |
3.0.0 |
---|
Arguments
- $word
string
The token to stem.
Response
string
_step5
Step 5
_step5(string $word) : string
since |
3.0.0 |
---|
Arguments
- $word
string
The 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
string
The type of stemmer to load.
Response
\Joomla\CMS\Language\LanguageStemmer
A LanguageStemmer instance.
stem
Method to stem a token and return the root.
stem(string $token, string $lang) : string
since |
3.0.0 |
---|
Arguments
- $token
string
The token to stem.- $lang
string
The language of the token.
Response
string
The 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