Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Helper

Fonctions membres publiques statiques

static parse ($input, $format='html')
 
static tokenize ($input, $lang, $phrase=false)
 
static stem ($token, $lang)
 
static addContentType ($title, $mime=null)
 
static isCommon ($token, $lang)
 
static getCommonWords ($lang)
 
static getDefaultLanguage ()
 
static getPrimaryLanguage ($lang)
 
static getContentExtras (Result $item)
 
static prepareContent ($text, $params=null, Result $item=null)
 

Description détaillée

Helper class for the Finder indexer package.

Depuis
2.5

Documentation des fonctions membres

◆ addContentType()

static addContentType (   $title,
  $mime = null 
)
static

Method to add a content type to the database.

Paramètres
string$titleThe type of content. For example: PDF
string$mimeThe mime type of the content. For example: PDF [optional]
Renvoie
integer The id of the content type.
Depuis
2.5
Exceptions
Exceptionon database error.

Références $db, $query, $title, et Factory\getDbo().

Référencé par Adapter\__construct().

◆ getCommonWords()

static getCommonWords (   $lang)
static

Method to get an array of common terms for a language.

Paramètres
string$langThe language to use.
Renvoie
array Array of common terms.
Depuis
2.5
Exceptions
Exceptionon database error.

Références $db, $lang, $query, et Factory\getDbo().

◆ getContentExtras()

static getContentExtras ( Result  $item)
static

Method to get extra data for a content before being indexed. This is how we add Comments, Tags, Labels, etc. that should be available to Finder.

Paramètres
Result$itemThe item to index as a Result object.
Renvoie
boolean True on success, false on failure.
Depuis
2.5
Exceptions
Exceptionon database error.

Références $item, Factory\getApplication(), et PluginHelper\importPlugin().

◆ getDefaultLanguage()

static getDefaultLanguage ( )
static

Method to get the default language for the site.

Renvoie
string The default language string.
Depuis
2.5

Références $lang, et ComponentHelper\getParams().

Référencé par Query\__construct(), et SuggestionsModel\populateState().

◆ getPrimaryLanguage()

static getPrimaryLanguage (   $lang)
static

Method to parse a language/locale key and return a simple language string.

Paramètres
string$langThe language/locale key. For example: en-GB
Renvoie
string The simple language string. For example: en
Depuis
2.5

Références $data, $lang, StringHelper\strpos(), et StringHelper\substr().

Référencé par Language\getInstance(), et SuggestionsModel\getListQuery().

◆ isCommon()

static isCommon (   $token,
  $lang 
)
static

Method to check if a token is common in a language.

Paramètres
string$tokenThe token to test.
string$langThe language to reference.
Renvoie
boolean True if common, false otherwise.
Depuis
2.5

Références $config, $data, $default, $lang, elseif, ComponentHelper\getParams(), et Multilanguage\isEnabled().

Référencé par Token\__construct().

◆ parse()

static parse (   $input,
  $format = 'html' 
)
static

Method to parse input into plain text.

Paramètres
string$inputThe raw input.
string$formatThe format of the input. [optional]
Renvoie
string The parsed input.
Depuis
2.5
Exceptions
Exceptionon invalid parser.

Références $format, $input, et Parser\getInstance().

Référencé par Indexer\index(), et Indexer\tokenizeToDbShort().

◆ prepareContent()

static prepareContent (   $text,
  $params = null,
Result  $item = null 
)
static

Method to process content text using the onContentPrepare event trigger.

Paramètres
string$textThe content to process.
Registry$paramsThe parameters object. [optional]
Result$itemThe item which get prepared. [optional]
Renvoie
string The processed content.
Depuis
2.5

Références $content, $item, $params, $text, Factory\getApplication(), Table\getInstance(), et PluginHelper\importPlugin().

◆ stem()

static stem (   $token,
  $lang 
)
static

Method to get the base word of a token.

Paramètres
string$tokenThe token to stem.
string$langThe language of the token.
Renvoie
string The root token.
Depuis
2.5

Références $config, $lang, $language, elseif, Language\getInstance(), ComponentHelper\getParams(), et Multilanguage\isEnabled().

Référencé par Token\__construct().

◆ tokenize()

static tokenize (   $input,
  $lang,
  $phrase = false 
)
static

Method to tokenize a text string.

Paramètres
string$inputThe input to tokenize.
string$langThe language of the input.
boolean$phraseFlag to indicate whether input could be a phrase. [optional]
Renvoie
Token[] An array of Token objects.
Depuis
2.5

We want to cache the most common words/tokens. At the same time we don't want to cache too much. The most common words will also be early in the text, so we are dropping all terms/tokens which have been cached later.

Références $config, $i, $input, $key, $lang, $language, $n, $params, $temp, elseif, Language\getInstance(), ComponentHelper\getParams(), et Multilanguage\isEnabled().

Référencé par Query\processString(), et Indexer\tokenizeToDbShort().


La documentation de cette classe a été générée à partir du fichier suivant :