class documentation

class BabelCategory(Tag):

View In Hierarchy

A Wikipedia category associated with a BabelSynset.

Static Method category_prefix Get the prefix of a category in the selected language.
Static Method from_string Create a new instance of a BabelCategory from a string with format <language_id>:<category_label>, e.g. EN:Scientist_who_committed_suicide.
Method __init__ init method
Property category The category itself, e.g. Scientists who commited suicide.
Property language The language of the category label, English, Italian, etc.
Property value Returns the tag value.
Property wikipedia_uri The URI of the Wikipedia page this BabelCategory corresponds to.
Method __repr__ Undocumented
Method __str__ Undocumented
Constant _BABEL_CATEGORY_PREFIX Category prefix (str)
Constant _WIKIPEDIA_URL_INFIX Wikipedia infix
Instance Variable _category the category
Instance Variable _language Undocumented
@staticmethod
def category_prefix(language):

Get the prefix of a category in the selected language.

Parameters
language:LanguageThe prefix language.
Returns
Optional[str]The prefix.
@staticmethod
def from_string(category_string):

Create a new instance of a BabelCategory from a string with format <language_id>:<category_label>, e.g. EN:Scientist_who_committed_suicide.

Parameters
category_string:strThe string of the category to be retrieved.
Returns
Optional[BabelCategory]An instance of a BabelCategory from an input string.
def __init__(self, category, language):

init method

Parameters
category:strThe category string.
language:LanguageThe category language.
@property
category: str =

The category itself, e.g. Scientists who commited suicide.

@property
language: Language =

The language of the category label, English, Italian, etc.

@property
value: str =

Returns the tag value.

@property
wikipedia_uri: str =

The URI of the Wikipedia page this BabelCategory corresponds to.

Examples:

  • for the English category Mathematicians_who_committed_suicide: http://en.wikipedia.org/wiki/Category:Mathematicians_who_committed_suicide
  • for the German category Kategorie:Mitglied der Royal Society: http://de.wikipedia.org/wiki/Kategorie:Mitglied_der_Royal_Society
def __repr__(self):

Undocumented

def __str__(self):

Undocumented

_BABEL_CATEGORY_PREFIX: str =

Category prefix (str)

Value
'BNCAT:'
_WIKIPEDIA_URL_INFIX: str =

Wikipedia infix

Value
'wikipedia.org/wiki/'
_category: str =

the category

_language =

Undocumented