Class BabelSense

    • Field Detail

      • fullLemma

        protected final String fullLemma
        The full lemma for this sense
      • simpleLemma

        protected final String simpleLemma
        The simple lemma for this sense (without parentheses, etc.)
      • lemma

        protected final BabelLemma lemma
        The BabelLemma for this sense
      • source

        protected final BabelSenseSource source
        The source of this lemma: WordNet, Wikipedia, translation, etc.
      • senseKey

        protected final String senseKey
        The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any
      • language

        protected final it.uniroma1.lcl.jlt.util.Language language
        The language of this sense
      • pos

        protected final it.uniroma1.lcl.jlt.util.POS pos
        The part-of-speech of this sense
      • synset

        protected transient BabelSynset synset
        The synset this sense belongs to
      • synsetID

        protected final BabelSynsetID synsetID
        The synset id this sense belongs to
    • Constructor Detail

      • BabelSense

        protected BabelSense​(String lemma,
                             String simpleLemma,
                             it.uniroma1.lcl.jlt.util.Language language,
                             it.uniroma1.lcl.jlt.util.POS pos,
                             BabelSenseSource source,
                             String sensekey,
                             BabelSynset synset)
        Creates a new instance of a BabelSense
        Parameters:
        language - the language of the sense
        lemma - the lemma of the sense
        simpleLemma - the simple lemma of the sense
        pos - the part of speech of the sense
        source - the source of the sense
        sensekey - the sense key
        synset - the synset the sense belongs to
    • Method Detail

      • getID

        public int getID()
        Gets the numeric id of the sense. Please use getSensekey() for a String id of the sense.
        Returns:
        the sense database identifier
      • isAutomaticTranslation

        public boolean isAutomaticTranslation()
        Returns true if the sense is the result of an automatic translation
        Returns:
        true if the sense is an automatic translation, false otherwise
      • isNotAutomaticTranslation

        public boolean isNotAutomaticTranslation()
        Returns true if the sense is NOT the result of an automatic translation
        Returns:
        true if the sense is NOT an automatic translation, false otherwise
      • isKeyConcept

        @Deprecated
        public boolean isKeyConcept()
        Deprecated.
        Use {@link BabelSense:isKeySense()} instead
        Returns:
        true if it is a key sense, false otherwise
      • isKeySense

        public boolean isKeySense()
        Description copied from interface: Sense
        Returns true if it is a key sense
        Specified by:
        isKeySense in interface Sense
        Returns:
        true if it is a key sense, false otherwise
      • getSimpleLemma

        @Deprecated
        public String getSimpleLemma()
        Deprecated.
        Description copied from interface: Sense
        Gets the simple lemma of this Sense. This corresponds to the lemma itself, if the lemma comes from WordNet, or the lemma possibly without sense labels (i.e. parentheses) if it comes from Wikipedia.
        Specified by:
        getSimpleLemma in interface Sense
        Returns:
        the simple lemma of this Sense.
      • getNormalizedLemma

        public String getNormalizedLemma()
        Description copied from interface: Sense
        Gets the normalized lemma of this Sense. This corresponds to the lower case lemma itself, if the lemma comes from WordNet, or the lower case lemma possibly without sense labels (i.e. parentheses) if it comes from Wikipedia.
        Specified by:
        getNormalizedLemma in interface Sense
        Returns:
        the normalized lemma of this Sense.
      • getLemma

        public BabelLemma getLemma()
        Description copied from interface: Sense
        Gets the lemma of this Sense.
        Specified by:
        getLemma in interface Sense
        Returns:
        the lemma of this Sense
      • getPOS

        public it.uniroma1.lcl.jlt.util.POS getPOS()
        Description copied from interface: Sense
        Gets the part of speech of this Sense.
        Specified by:
        getPOS in interface Sense
        Returns:
        the part of speech of this Sense.
      • getLanguage

        public it.uniroma1.lcl.jlt.util.Language getLanguage()
        Description copied from interface: Sense
        Gets the Language of this Sense
        Specified by:
        getLanguage in interface Sense
        Returns:
        the Language of this Sense.
      • getSensekey

        public String getSensekey()
        Gets the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense to which this BabelSense corresponds, if any.
        Returns:
        the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense corresponding to this BabelSense.
      • getPosition

        @Deprecated
        public Integer getPosition()
        Deprecated.
        Moved to WordNetSense
        Gets the WordNet position of the WordNet sense to which this BabelSense corresponds, if any.
        Returns:
        the position of the WordNet sense corresponding to this BabelSense.
      • getFrequency

        @Deprecated
        public Integer getFrequency()
        Deprecated.
        Discontinued
        Gets the frequency score for this BabelSense. This score represents, for a Wikipedia page/redirection, the number of its incoming links. Otherwise it is null.
        Returns:
        the frequency of this BabelSense.
      • getSynsetID

        public BabelSynsetID getSynsetID()
        Description copied from interface: Sense
        Returns the id of the Synset the sense belongs to
        Specified by:
        getSynsetID in interface Sense
        Returns:
        SynsetID the id of the Synset the sense belongs to
      • getYAGOURI

        @Deprecated
        public String getYAGOURI()
        Deprecated.
        Get a link to the corresponding YAGO URI (empty String if no interlinking is available or possible)
        Returns:
        a link to the corresponding YAGO URI.
        See Also:
        YAGO
      • getGeoNamesURI

        @Deprecated
        public String getGeoNamesURI()
        Deprecated.
        Get a link to the corresponding GeoNames URI (empty String if no interlinking is available or possible)
        Returns:
        a link to the corresponding GeoNames URI.
        See Also:
        GeoNames
      • getFrameNetURI

        @Deprecated
        public String getFrameNetURI()
        Deprecated.
        Get a link to the corresponding FremaNet URI (empty String if no interlinking is available or possible)
        Returns:
        a link to the corresponding FrameNet URI.
        See Also:
        FrameNet
      • getVerbNetURI

        @Deprecated
        public String getVerbNetURI()
        Deprecated.
        Get a link to the corresponding VerbNet URI (empty String if no interlinking is available or possible)
        Returns:
        a link to the corresponding VerbNet URI.
        See Also:
        VerbNet
      • getSenseString

        @Deprecated
        public String getSenseString()
        Deprecated.
        Please use getSensekey()
        Gets a String-based representation of this BabelSense alternative to the "canonical" one obtained using toString(). This corresponds to a diesis-like representation if the sense belongs to WordNet, e.g. "car#n#1" or "funk#n#3", or the page title (with no prefix) it if corresponds to a Wikipedia sense, otherwise the lemma if it is a translation
        Returns:
        a string representing this BabelSense.
      • getSenseNumber

        @Deprecated
        public int getSenseNumber()
        Deprecated.
        Moved to WordNetSense
        Gets the sense number of this BabelSense. This corresponds to the sense number found in WordNet, if the sense belongs to WordNet, 0 otherwise.
        Returns:
        the sense number of this BabelSense.
      • getLicense

        public BabelLicense getLicense()
        Returns the license for this Babel sense
        Returns:
        the license
      • getTags

        public <T extends TagCollection<T> getTags​(Class<T> classTag)
        Description copied from interface: Taggable
        Returns the collection of the given class of this Taggable.
        Specified by:
        getTags in interface Taggable
        Type Parameters:
        T - the Tag type
        Parameters:
        classTag - the class for the search.
        Returns:
        the collection of the given class
      • isTaggedAs

        public boolean isTaggedAs​(Tag... tags)
        Description copied from interface: Taggable
        Checks if all the given tags are contained in this Taggable.
        Specified by:
        isTaggedAs in interface Taggable
        Parameters:
        tags - the tags of interest
        Returns:
        true if all the given tags are contained in this Taggable, false othwerwise
      • isTaggedAs

        public boolean isTaggedAs​(Collection<Tag> tags)
        Description copied from interface: Taggable
        Checks if all the given tags are contained in this Taggable.
        Specified by:
        isTaggedAs in interface Taggable
        Parameters:
        tags - the tags of interest
        Returns:
        true if all the given tags are contained in this Taggable, false othwerwise
      • isTaggedAs

        public boolean isTaggedAs​(Tag tag)
        Description copied from interface: Taggable
        Checks if the given tag are contained in this Taggable.
        Specified by:
        isTaggedAs in interface Taggable
        Parameters:
        tag - the tag of interest
        Returns:
        true if all the given tags are contained in this Taggable, false othwerwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object