WikibaseLexeme
MediaWiki WikibaseLexeme extension
Loading...
Searching...
No Matches
Wikibase\Lexeme\DataAccess\LexemeDescription Class Reference

Class for generating Lexeme description strings. More...

Public Member Functions

 __construct (LabelDescriptionLookup $lookup, EntityIdParser $idParser, Language $displayLanguage)
 
 getLabelOrDefault (?EntityId $id=null, $default="")
 Get label or return empty string.
 
 createDescription (EntityId $id, $language, $category)
 Create short lexeme description, e.g.: "German noun" or "English verb" Currently not uses the ID, may change later.
 
 createFormDescription (EntityId $lexemeId, array $features, $lemma, $language, $category)
 Create Form descriptions, along the lines of: singular genitive for Leiter (L1): German noun.
 

Static Public Member Functions

static parseOrNull ( $text, EntityIdParser $idParser)
 Parse entity ID or return null.
 

Private Attributes

 $lookup
 
 $idParser
 
 $displayLanguage
 

Detailed Description

Class for generating Lexeme description strings.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\DataAccess\LexemeDescription::__construct ( LabelDescriptionLookup $lookup,
EntityIdParser $idParser,
Language $displayLanguage )

Member Function Documentation

◆ createDescription()

Wikibase\Lexeme\DataAccess\LexemeDescription::createDescription ( EntityId $id,
$language,
$category )

Create short lexeme description, e.g.: "German noun" or "English verb" Currently not uses the ID, may change later.

Parameters
EntityId$idLexeme ID
string$languageLanguage ID, as string
string$categoryLexical category ID, as string
Returns
string

◆ createFormDescription()

Wikibase\Lexeme\DataAccess\LexemeDescription::createFormDescription ( EntityId $lexemeId,
array $features,
$lemma,
$language,
$category )

Create Form descriptions, along the lines of: singular genitive for Leiter (L1): German noun.

Parameters
EntityId$lexemeIdMain lexeme
EntityId[]$featuresForm feature IDs list
string$lemmaLexeme's lemma
string$languageLanguage ID, as string
string$categoryLexical category ID, as string
Returns
string

◆ getLabelOrDefault()

Wikibase\Lexeme\DataAccess\LexemeDescription::getLabelOrDefault ( ?EntityId $id = null,
$default = "" )

Get label or return empty string.

Parameters
EntityId | null$id
string$defaultDefault value if unable to retrieve label
Returns
string Label or "" if does not exist.

◆ parseOrNull()

static Wikibase\Lexeme\DataAccess\LexemeDescription::parseOrNull ( $text,
EntityIdParser $idParser )
static

Parse entity ID or return null.

Parameters
string$text
EntityIdParser$idParser
Returns
null|EntityId

Member Data Documentation

◆ $displayLanguage

Wikibase\Lexeme\DataAccess\LexemeDescription::$displayLanguage
private

◆ $idParser

Wikibase\Lexeme\DataAccess\LexemeDescription::$idParser
private

◆ $lookup

Wikibase\Lexeme\DataAccess\LexemeDescription::$lookup
private

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