LemmatizerManager
in package
Manages lemmatizer instantiation and NLP availability checks.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructor.
- getAllNlpLanguages() : array<string|int, string>
- Get all languages potentially supported by NLP (including uninstalled models).
- getAvailableLanguages() : array<string|int, string>
- Get all languages with available lemmatization support.
- getLemmatizerByType() : LemmatizerInterface
- Get a lemmatizer by type.
- getLemmatizerForLanguage() : LemmatizerInterface
- Get the best available lemmatizer for a language.
- getNlpSupportedLanguages() : array<string|int, string>
- Get languages supported by the NLP service.
- isAvailableForLanguage() : bool
- Check if lemmatization is available for a language.
- isNlpServiceAvailable() : bool
- Check if NLP service (spaCy) is available.
Properties
$lemmatizer
private
LemmatizerInterface
$lemmatizer
Methods
__construct()
Constructor.
public
__construct(LemmatizerInterface $lemmatizer) : mixed
Parameters
- $lemmatizer : LemmatizerInterface
-
Lemmatizer implementation
getAllNlpLanguages()
Get all languages potentially supported by NLP (including uninstalled models).
public
getAllNlpLanguages() : array<string|int, string>
Return values
array<string|int, string>getAvailableLanguages()
Get all languages with available lemmatization support.
public
getAvailableLanguages() : array<string|int, string>
Return values
array<string|int, string> —Array of language codes
getLemmatizerByType()
Get a lemmatizer by type.
public
getLemmatizerByType(string $type) : LemmatizerInterface
Parameters
- $type : string
-
Lemmatizer type ('dictionary', 'spacy', 'hybrid')
Return values
LemmatizerInterfacegetLemmatizerForLanguage()
Get the best available lemmatizer for a language.
public
getLemmatizerForLanguage(string $languageCode) : LemmatizerInterface
Uses the LemmatizerFactory to select the appropriate lemmatizer based on language configuration and availability.
Parameters
- $languageCode : string
-
ISO language code
Return values
LemmatizerInterfacegetNlpSupportedLanguages()
Get languages supported by the NLP service.
public
getNlpSupportedLanguages() : array<string|int, string>
Return values
array<string|int, string>isAvailableForLanguage()
Check if lemmatization is available for a language.
public
isAvailableForLanguage(string $languageCode) : bool
Parameters
- $languageCode : string
-
ISO language code
Return values
bool —True if lemmatization is available
isNlpServiceAvailable()
Check if NLP service (spaCy) is available.
public
isNlpServiceAvailable() : bool