MediaWiki master
Wikimedia\Leximorph\Handler\Overrides\GrammarFallbackRegistry Class Reference

GrammarFallbackRegistry. More...

Public Member Functions

 apply (string $langCode, string $word, string $case)
 Applies a grammar transformation using the transformer for the given language.
 
 getProcessor (string $langCode)
 Retrieves the grammar transformer for the given language, if defined.
 

Protected Member Functions

 getSpecArgs (array $spec, LoggerInterface $logger)
 
 getSpecMap ()
 

Detailed Description

GrammarFallbackRegistry.

Manages the registration and retrieval of language-specific grammar transformers, which can be used to apply procedural grammar fallbacks for specific languages.

Since
1.45
Author
Doğu Abaris (abari.nosp@m.s@nu.nosp@m.ll.ne.nosp@m.t)
Note
https://www.gnu.org/copyleft/gpl.html GPL-2.0-or-later

Definition at line 33 of file GrammarFallbackRegistry.php.

Member Function Documentation

◆ apply()

Wikimedia\Leximorph\Handler\Overrides\GrammarFallbackRegistry::apply ( string $langCode,
string $word,
string $case )

Applies a grammar transformation using the transformer for the given language.

Parameters
string$langCodeLanguage code.
string$wordWord or phrase to transform.
string$caseGrammatical case (e.g., 'genitive', 'instrumental').
Since
1.45
Returns
string Transformed word if processor exists, otherwise original.

Definition at line 132 of file GrammarFallbackRegistry.php.

◆ getProcessor()

Wikimedia\Leximorph\Handler\Overrides\GrammarFallbackRegistry::getProcessor ( string $langCode)

Retrieves the grammar transformer for the given language, if defined.

Parameters
string$langCodeLanguage code.
Since
1.45
Returns
?IGrammarTransformer

Definition at line 113 of file GrammarFallbackRegistry.php.

◆ getSpecArgs()

Wikimedia\Leximorph\Handler\Overrides\GrammarFallbackRegistry::getSpecArgs ( array $spec,
LoggerInterface $logger )
protected

Definition at line 101 of file GrammarFallbackRegistry.php.

◆ getSpecMap()

Wikimedia\Leximorph\Handler\Overrides\GrammarFallbackRegistry::getSpecMap ( )
protected

Definition at line 87 of file GrammarFallbackRegistry.php.


The documentation for this class was generated from the following file: