Class BabelNet

java.lang.Object
it.uniroma1.lcl.babelnet.BabelNet
All Implemented Interfaces:
LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>, Iterable<BabelSynset>

public abstract class BabelNet extends Object implements LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
A class to programmatically access BabelNet.
Author:
navigli, vannella, cecconi
  • Field Details

    • indexManager

      protected static it.uniroma1.lcl.babelnet.BabelNetIndexManager indexManager
      Lucene index manager
  • Constructor Details

    • BabelNet

      protected BabelNet()
      BabelNet default constructor
  • Method Details

    • getInstance

      public static BabelNet getInstance()
      Returns the singleton instance of the BabelNet class
      Returns:
      the instance of BabelNet
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      normalized - enables normalized search
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      searchLanguage - the language of the input word.
      targetLanguages - the languages in which the data are to be retrieved.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      searchLanguage - the language of the input word.
      targetLanguages - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      searchLanguage - the language of the input word.
      pos - the PoS of the word.
      targetLanguages - the languages in which the data are to be retrieved.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language searchLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      searchLanguage - the language of the input word.
      pos - the PoS of the word.
      targetLanguages - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      normalized - enables normalized search
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language sourceLanguage, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLanguages, boolean normalized, BabelSenseSource... allowedSources)
      Returns the senses for the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      sourceLanguage - the language of the input word.
      pos - the PoS of the word.
      targetLanguages - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the senses of the word.
    • getSensesFrom

      public List<BabelSense> getSensesFrom(String word)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word in any language.
      Specified by:
      getSensesFrom in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      Returns:
      the senses of the word.
    • getSensesFrom

      public List<BabelSense> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word in the given language.
      Specified by:
      getSensesFrom in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      Returns:
      the senses of the word.
    • getSensesFrom

      public List<BabelSense> getSensesFrom(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word with the given constraints.
      Specified by:
      getSensesFrom in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      Returns:
      the senses of the word.
    • getSensesContaining

      public List<BabelSense> getSensesContaining(String word)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word in any language.
      Specified by:
      getSensesContaining in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      Returns:
      the senses of the word.
    • getSensesContaining

      public List<BabelSense> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word in the given language.
      Specified by:
      getSensesContaining in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      Returns:
      the senses of the word.
    • getSensesContaining

      public List<BabelSense> getSensesContaining(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
      Description copied from interface: LKB
      Returns the senses of synsets containing the word with the given constraints.
      Specified by:
      getSensesContaining in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word)
      Deprecated.
      Returns the senses of synsets containing the word in any language.
      Parameters:
      word - the word whose senses are to be retrieved.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language)
      Returns the senses of synsets containing the word in the given language.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      Returns:
      the senses of the word.
    • getSenses

      @Deprecated public List<BabelSense> getSenses(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
      Returns the senses of synsets containing the word with the given constraints.
      Parameters:
      word - the word whose senses are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      Returns:
      the senses of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word)
      Description copied from interface: LKB
      Given a word, returns the synsets for the word.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose synsets are to be retrieved.
      Returns:
      the synsets of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language)
      Description copied from interface: LKB
      Given a word in a certain language, returns the synsets for the word.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos)
      Description copied from interface: LKB
      Given a word in a certain language, returns the synsets for the word.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      Returns:
      the synsets of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
      Description copied from interface: LKB
      Given a word and a collection of languages, returns the senses for the word available in the given sense sources.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose senses are to be retrieved.
      searchLangs - a collection of languages that can be used to look up the input word.
      Returns:
      the senses of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs, it.uniroma1.lcl.jlt.util.POS pos)
      Description copied from interface: LKB
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      word - the word whose synsets are to be retrieved.
      searchLangs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      Returns:
      the synsets of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(ResourceID... resourceIds)
      Description copied from interface: LKB
      Given a list of ResourceIDs, returns the synsets identified by the ResourceIDs in input.
      Specified by:
      getSynsets in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      resourceIds - the resource identifiers
      Returns:
      the synsets identified by the given ResourceIDs
    • getSynset

      public BabelSynset getSynset(ResourceID resourceID)
      Description copied from interface: LKB
      Given a ResourceID, returns the synset identified by the ResourceID in input.

      Note: It is possible that this method gives a warning if the ResourceID returns more than one synset. In that case the best (see InternalBabelSynsetComparator) sense will be returned.

      Specified by:
      getSynset in interface LKB<BabelSynset, BabelSense, BabelSynsetRelation, BabelPointer, BabelGloss, BabelExample, BabelNetQuery>
      Parameters:
      resourceID - the resource identifier
      Returns:
      the synset identified by the ResourceID

      Some examples that can be used follow, assuming:

      BabelNet bn = BabelNet.getInstance();

      Retrieving BabelSynset from a Wikipedia page title:

         BabelSynset synset = bn.getSynset(new WikipediaID("BabelNet", Language.EN, BabelPOS.NOUN));

      Retrieving BabelSynset from a Wikiquote page title:

         BabelSynset synset =  bn.getSynset(new WikiquoteID("Home", Language.EN, BabelPOS.NOUN));

      Retrieving BabelSynset from a WordNet id:

       BabelSynset synset = bn.getSynset(new WordNetSynsetID("wn:03544360n"));

      Retrieving BabelSynset from a Wikidata page id:

       BabelSynset synset = bn.getSynset(new WikidataID("Q4837690"));

      Retrieving BabelSynset from a OmegaWiki page id:

       BabelSynset synset = bn.getSynset(new OmegaWikiID("1499705"));
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, boolean normalized)
      Given a word, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, boolean normalized)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      targetLangs - the languages in which the data are to be retrieved.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, boolean normalized)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      targetLangs - the languages in which the data are to be retrieved.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      Returns:
      the synsets of the word.
    • getSynsets

      public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
      Given a word in a certain language, returns the synsets for the word.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
      Given a word in a certain language, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
      Given a word in a certain language, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      normalized - enables normalized search
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
      Given a word in a certain language, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, it.uniroma1.lcl.jlt.util.Language language, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
      Given a word in a certain language, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      language - the language of the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      allowedSources - sources used to search
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, BabelSenseSource... allowedSources)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, boolean normalized, BabelSenseSource... allowedSources)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      normalized - enables normalized search
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, BabelSenseSource... allowedSources)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(String word, Collection<it.uniroma1.lcl.jlt.util.Language> langs, it.uniroma1.lcl.jlt.util.POS pos, Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, boolean normalized, BabelSenseSource... allowedSources)
      Given a word and a collection of languages, returns the synsets for the word available in the given sense sources.
      Parameters:
      word - the word whose synsets are to be retrieved.
      langs - a collection of languages that can be used to look up the input word.
      pos - the PoS of the word.
      targetLangs - the languages in which the data are to be retrieved.
      normalized - enables normalized search
      allowedSources - the BabelSenseSources that can be used to look up the possible senses of the input word.
      Returns:
      the synsets of the word.
    • getSynsets

      @Deprecated public List<BabelSynset> getSynsets(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID... resourceIds)
      Given a list of ResourceIDs, returns the synsets identified by the ResourceIDs in input.
      Parameters:
      targetLangs - the languages in which the data are to be retrieved.
      resourceIds - the resource identifiers
      Returns:
      the synsets identified by the given ResourceIDs
    • getSynset

      @Deprecated public BabelSynset getSynset(Collection<it.uniroma1.lcl.jlt.util.Language> targetLangs, ResourceID resourceID)
      Given a ResourceID, returns the synset identified by the ResourceID in input.

      Note: It is possible that this method gives a warning if the ResourceID returns more than one synset. In that case the best (see InternalBabelSynsetComparator) sense will be returned.

      Parameters:
      targetLangs - the languages in which the data are to be retrieved.
      resourceID - the resource identifier
      Returns:
      the synset identified by the ResourceID
    • getOutgoingEdges

      @Deprecated protected abstract List<BabelSynsetRelation> getOutgoingEdges(BabelSynsetID id, Collection<it.uniroma1.lcl.jlt.util.Language> searchLangs)
      Returns the outgoing edges from a given BabelSynsetID
      Parameters:
      id - the BabelSynsetID whose outgoing edges we want to retrieve
      searchLangs - the search languages of the edges
      Returns:
      the list of relation edges
    • getOutgoingEdges

      protected abstract List<BabelSynsetRelation> getOutgoingEdges(BabelSynsetID id)
      Returns the outgoing edges from a given BabelSynsetID
      Parameters:
      id - the BabelSynsetID whose outgoing edges we want to retrieve
      Returns:
      the list of relation edges
    • getSynsetIterator

      @Deprecated public Iterator<BabelSynset> getSynsetIterator()
      Deprecated.
      Please use LKB.iterator().
      Creates a new instance of BabelSynsetIterator.
      Returns:
      an instance of a BabelSynsetIterator.
    • stream

      public Stream<BabelSynset> stream()
      Returns the full stream of BabelSynsets
      Returns:
      the stream of BabelSynsets
    • lexiconStream

      public Stream<it.uniroma1.lcl.jlt.ling.Word> lexiconStream()
      Returns the full stream of BabelSynsets
      Returns:
      the stream of BabelSynsets
    • offsetStream

      public Stream<String> offsetStream()
      Returns the full stream of string offsets of BabelSynsets
      Returns:
      the stream of BabelSynsets
    • getWordNetStream

      public Stream<BabelSynset> getWordNetStream()
      Returns the full stream of the WordNet BabelSynsets
      Returns:
      the stream of the WordNet BabelSynsets
    • senseStream

      public Stream<BabelSense> senseStream()
      Returns the full stream of BabelSenses
      Returns:
      the stream of BabelSenses
    • senseStream

      public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language)
      Returns the full stream of BabelSenses in a given Language
      Parameters:
      language - the language of the senses
      Returns:
      the stream of BabelSenses
    • senseStream

      public Stream<BabelSense> senseStream(BabelSenseSource source)
      Returns the full stream of BabelSenses belonging to a given BabelSenseSource
      Parameters:
      source - the source of the senses
      Returns:
      the stream of BabelSenses
    • senseStream

      public Stream<BabelSense> senseStream(it.uniroma1.lcl.jlt.util.Language language, BabelSenseSource source)
      Returns the full stream of BabelSenses with the given constraints
      Parameters:
      language - the language of the senses
      source - the source of the senses
      Returns:
      the stream of BabelSenses
    • getIndexManager

      protected it.uniroma1.lcl.babelnet.BabelNetIndexManager getIndexManager()
      Returns the BabelNetIndexManager
      Returns:
      the BabelNetIndexManager