Porteren
Implements StemmerInterfacePorter English stemmer class.
This class was adapted from one written by Richard Heyes. See copyright and link information above.
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
cvc
Checks for ending CVC sequence where second C is not W, X or Y
cvc(string str) : bool
since |
1.0 |
---|
Arguments
- str
string
String to check
Response
bool
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) : bool
since |
1.0 |
---|
Arguments
- str
string
String to check
Response
bool
Result
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 |
1.0 |
---|
Arguments
- str
string
The string to return the m count for
Response
int
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(string &str, string check, string repl, int m = null) : bool
since |
1.0 |
---|
Arguments
- str
string
String to check- check
string
Ending to check for- repl
string
Replacement string- m
int
Optional minimum number of m() to meet
Response
bool
Whether the $check string was at the end
of the $str string. True does not necessarily mean
that it was replaced.
stem
Method to stem a token and return the root.
stem(string token, string lang) : string
since |
1.0 |
---|
Arguments
- token
string
The token to stem.- lang
string
The language of the token.
Response
string
The root token.
step1ab
Step 1
step1ab(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
step1c
Step 1c
step1c(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
step2
Step 2
step2(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
step3
Step 3
step3(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
step4
Step 4
step4(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
step5
Step 5
step5(string word) : string
since |
1.0 |
---|
Arguments
- word
string
The token to stem.
Response
string
Properties
cache
An internal cache of stemmed tokens.
since |
1.0 |
---|
Type(s)
array
regexConsonant
Regex for matching a consonant.
since |
1.4.0 |
---|
Type(s)
string
regexVowel
Regex for matching a vowel
since |
1.4.0 |
---|
Type(s)
string