Class BabelCategory

java.lang.Object
it.uniroma1.lcl.babelnet.data.BabelCategory
All Implemented Interfaces:
Tag<String>

public class BabelCategory extends Object implements Tag<String>
A Wikipedia category associated with a BabelSynset.
Author:
navigli, ponzetto
  • Field Details

  • Constructor Details

    • BabelCategory

      public BabelCategory(String category, it.uniroma1.lcl.jlt.util.Language language)
      Creates a new instance of a BabelCategory
      Parameters:
      category - the category string
      language - the category language
  • Method Details

    • getValue

      public String getValue()
      Gets the label of this BabelCategory.
      Specified by:
      getValue in interface Tag<String>
      Returns:
      the label of this BabelCategory.
    • getLanguage

      public it.uniroma1.lcl.jlt.util.Language getLanguage()
      Gets the language of this BabelCategory.
      Returns:
      the language of this BabelCategory.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getWikipediaURI

      public String getWikipediaURI()
      Gets the URI of the Wikipedia page this BabelCategory corresponds to. For instance "http://en.wikipedia.org/wiki/Category:Mathematicians_who_committed_suicide" for the English category "Mathematicians_who_committed_suicide" and "http://de.wikipedia.org/wiki/Kategorie:Mitglied_der_Royal_Society" for the German category "Kategorie:Mitglied der Royal Society"
      Returns:
      the Wikipedia URI for the page corresponding to this BabelCategory.
    • fromString

      public static BabelCategory fromString(String categoryString)
      Creates a new instance of a BabelCategory from a string with format [language_id]:[category_label], e.g. EN:Scientist_who_committed_suicide
      Parameters:
      categoryString - the string of the category to be retrieved
      Returns:
      an instance of a BabelCategory from an input string
    • getLicense

      public BabelLicense getLicense()
      Returns the BabelLicense for this Babel category
      Returns:
      the license for this category