Class WordNetSense

  • All Implemented Interfaces:
    Taggable, Sense

    public class WordNetSense
    extends BabelSense
    A WordNet sense. Provides WordNet-specific methods.
    Author:
    navigli
    • Field Detail

      • wordNetSenseNumber

        protected Integer wordNetSenseNumber
        The sense number of the WordNet if any
      • wordNetOffset

        protected String wordNetOffset
        The offset of the WordNet sense to which this sense corresponds, if any
      • wordNetSynsetPosition

        protected Integer wordNetSynsetPosition
        The position of the WordNet sense to which this sense corresponds,
    • Constructor Detail

      • WordNetSense

        protected WordNetSense​(String lemma,
                               String simpleLemma,
                               it.uniroma1.lcl.jlt.util.Language language,
                               it.uniroma1.lcl.jlt.util.POS pos,
                               String sensekey,
                               BabelSynset synset,
                               String wordNetOffset,
                               Integer wordNetSynsetPosition,
                               Integer wordNetSenseNumber,
                               BabelSenseSource source)
        Creates a new instance of a WordNetSense
        Parameters:
        lemma - the lemma of the sense
        language - the language of the sense
        pos - the part of speech of the sense
        sensekey - the sense key
        synset - the synset the sense belongs to
        wordNetOffset - WordNet synset offset
        wordNetSynsetPosition - position in the synset
        wordNetSenseNumber - sense number in WordNet
        source - the sense source
    • Method Detail

      • getSenseNumber

        public int getSenseNumber()
        Gets the sense number of this BabelSense. This corresponds to the sense number found in WordNet, if the sense belongs to WordNet, 0 otherwise.
        Overrides:
        getSenseNumber in class BabelSense
        Returns:
        the sense number of this BabelSense.
      • getSenseString

        public String getSenseString()
        Description copied from class: BabelSense
        Gets a String-based representation of this BabelSense alternative to the "canonical" one obtained using BabelSense.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
        Overrides:
        getSenseString in class BabelSense
        Returns:
        a string representing this BabelSense.