LexData

The central Class for working with LexData is the Class Lexeme, it is documented on a separate page:

Other Classes and Functions

LexData.create_lexeme(repo: LexData.wikidatasession.WikidataSession, lemma: str, lang: LexData.language.Language, catLex: str, claims=None) → LexData.lexeme.Lexeme

Creates a lexeme

This function will created a lexeme on Wikidata with the given lemma, language and lexicographical category. Optionally claims can be added to the lexeme. The created lexeme is returned and can be edited further.

Parameters
  • repo (WikidataSession) – Wikidata Session

  • lemma (str) – value of the lexeme

  • lang (Language) – language

  • catLex (str) – lexicographical category

  • claims – claims to add to the lexeme (Default value = None) -> Lexem)

Returns

The created Lexeme

Return type

Lexeme

LexData.get_or_create_lexeme(repo: LexData.wikidatasession.WikidataSession, lemma: str, lang: LexData.language.Language, catLex: str) → LexData.lexeme.Lexeme

Search for a lexeme in wikidata if not found, create it

Parameters
  • repo (WikidataSession) – Wikidata Session

  • lemma (str) – the lemma of the lexeme

  • lang (Language) – language of the lexeme

  • catLex (str) – lexical Category of the lexeme

Returns

Lexeme with the specified properties (created or found)

Return type

Lexeme

LexData.search_lexemes(repo: LexData.wikidatasession.WikidataSession, lemma: str, lang: LexData.language.Language, catLex: str) → List[LexData.lexeme.Lexeme]

Search for lexemes by their label, language and lexical category.

Parameters
  • repo (WikidataSession) – Wikidata Session

  • lemma (str) – the lemma of the lexeme

  • lang (Language) – language of the lexeme

  • catLex (str) – lexical Category of the lexeme

Returns

List of Lexemes with the specified properties

Return type

List[Lexeme]