Class BabelSense
java.lang.Object
it.uniroma1.lcl.babelnet.BabelSense
- Direct Known Subclasses:
WordNetSense
A sense in
BabelNet, contained in a BabelSynset.- Author:
- navigli, ponzetto
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe full lemma for this senseprotected final it.uniroma1.lcl.jlt.util.LanguageThe language of this senseprotected final BabelLemmaThe BabelLemma for this senseprotected final it.uniroma1.lcl.jlt.util.POSThe part-of-speech of this senseprotected final StringThe sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if anyprotected final StringThe simple lemma for this sense (without parentheses, etc.)protected final BabelSenseSourceThe source of this lemma: WordNet, Wikipedia, translation, etc.protected BabelSynsetThe synset this sense belongs toprotected final BabelSynsetIDThe synset id this sense belongs to -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBabelSense(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 aBabelSense -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Deprecated.Deprecated.DiscontinuedGets the full lemma of thisSense(which might include annotations, such as labels in Wikipedia page titles).Deprecated.Returns theBabelGlosses associated to thisSense.intgetID()Gets the numeric id of the sense.it.uniroma1.lcl.jlt.util.LanguageGets theLanguageof thisSensegetLemma()Gets the lemma of thisSense.Returns the license for this Babel senseGets the normalized lemma of thisSense.it.uniroma1.lcl.jlt.util.POSgetPOS()Gets the part of speech of thisSense.Deprecated.Moved toWordNetSenseReturns the pronunciationsGets the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense to which thisBabelSensecorresponds, if any.intDeprecated.Moved toWordNetSenseDeprecated.Please usegetSensekey()Deprecated.To be removed in the next API releaseDeprecated.Gets theBabelSenseSourceof thisSense.Gets theBabelSynsetthisSensebelongs to.Returns the id of theSynsetthe sense belongs togetTags()<T extends Tag>
Collection<T> Returns the collection of the given class of thisTaggable.Deprecated.Deprecated.Moved toWordNetSenseDeprecated.inthashCode()booleanReturns true if the sense is the result of an automatic translationbooleanDeprecated.UseisKeySense()insteadbooleanReturns true if it is a key sensebooleanReturns true if the sense is NOT the result of an automatic translationbooleanisTaggedAs(Tag tag) Checks if the given tag are contained in thisTaggable.booleanisTaggedAs(Tag... tags) Checks if all the given tags are contained in thisTaggable.booleanisTaggedAs(Collection<Tag> tags) Checks if all the given tags are contained in thisTaggable.toString()toURI(ExternalResource resource) Returns the URI of the sense for a givenExternalResource
-
Field Details
-
fullLemma
The full lemma for this sense -
simpleLemma
The simple lemma for this sense (without parentheses, etc.) -
lemma
The BabelLemma for this sense -
source
The source of this lemma: WordNet, Wikipedia, translation, etc. -
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 languageThe language of this sense -
pos
protected final it.uniroma1.lcl.jlt.util.POS posThe part-of-speech of this sense -
synset
The synset this sense belongs to -
synsetID
The synset id this sense belongs to
-
-
Constructor Details
-
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 aBabelSense- Parameters:
lemma- the lemma of the sensesimpleLemma- the simple lemma of the senselanguage- the language of the sensepos- the part of speech of the sensesource- the source of the sensesensekey- the sense keysynset- the synset the sense belongs to
-
-
Method Details
-
getID
public int getID()Gets the numeric id of the sense. Please usegetSensekey()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.UseisKeySense()instead- Returns:
- true if it is a key sense, false otherwise
-
isKeySense
public boolean isKeySense()Description copied from interface:SenseReturns true if it is a key sense- Specified by:
isKeySensein interfaceSense- Returns:
- true if it is a key sense, false otherwise
-
getFullLemma
Description copied from interface:SenseGets the full lemma of thisSense(which might include annotations, such as labels in Wikipedia page titles). UseSense.getNormalizedLemma()to retrieve plain lemmas lower case orSense.getLemma().- Specified by:
getFullLemmain interfaceSense- Returns:
- the lemma of this
Sense.
-
getSimpleLemma
Deprecated.Description copied from interface:SenseGets the simple lemma of thisSense. 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:
getSimpleLemmain interfaceSense- Returns:
- the simple lemma of this
Sense.
-
getNormalizedLemma
Description copied from interface:SenseGets the normalized lemma of thisSense. 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:
getNormalizedLemmain interfaceSense- Returns:
- the normalized lemma of this
Sense.
-
getLemma
-
getPOS
-
getSource
Description copied from interface:SenseGets theBabelSenseSourceof thisSense.- Specified by:
getSourcein interfaceSense- Returns:
- the
BabelSenseSourceof thisSense.
-
getLanguage
public it.uniroma1.lcl.jlt.util.Language getLanguage()Description copied from interface:SenseGets theLanguageof thisSense- Specified by:
getLanguagein interfaceSense- Returns:
- the
Languageof thisSense.
-
getSynset
Description copied from interface:SenseGets theBabelSynsetthisSensebelongs to.- Specified by:
getSynsetin interfaceSense- Returns:
- the
BabelSynsetof thisSense.
-
getSensekey
Gets the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense to which thisBabelSensecorresponds, if any.- Returns:
- the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense corresponding to this
BabelSense.
-
getWordNetOffset
Deprecated.Moved toWordNetSenseGets the WordNet offset of the WordNet sense to which thisBabelSensecorresponds, if any.- Returns:
- the offset of the WordNet sense corresponding to this
BabelSense.
-
getPosition
Deprecated.Moved toWordNetSenseGets the WordNet position of the WordNet sense to which thisBabelSensecorresponds, if any.- Returns:
- the position of the WordNet sense corresponding to this
BabelSense.
-
getFrequency
Deprecated.DiscontinuedGets the frequency score for thisBabelSense. This score represents, for a Wikipedia page/redirection, the number of its incoming links. Otherwise it is null.- Returns:
- the frequency of this
BabelSense.
-
getSenseTranslationInfo
Deprecated.To be removed in the next API releaseGets translation-related information about thisBabelSense.- Returns:
- translation-related information about this
BabelSense.
-
getPronunciations
Returns the pronunciations- Returns:
- BabelSensePronunciations
BabelSense
-
getSynsetID
Description copied from interface:SenseReturns the id of theSynsetthe sense belongs to- Specified by:
getSynsetIDin interfaceSense- Returns:
- SynsetID the id of the
Synsetthe sense belongs to
-
toURI
Description copied from interface:SenseReturns the URI of the sense for a givenExternalResource -
getDBPediaURI
Deprecated.Get a link to the corresponding DBPedia URI (emptyStringif no interlinking is available or possible)- Returns:
- a link to the corresponding DBPedia URI.
- See Also:
-
getYAGOURI
Deprecated.Get a link to the corresponding YAGO URI (emptyStringif no interlinking is available or possible)- Returns:
- a link to the corresponding YAGO URI.
- See Also:
-
getGeoNamesURI
Deprecated.Get a link to the corresponding GeoNames URI (emptyStringif no interlinking is available or possible)- Returns:
- a link to the corresponding GeoNames URI.
- See Also:
-
getFrameNetURI
Deprecated.Get a link to the corresponding FremaNet URI (emptyStringif no interlinking is available or possible)- Returns:
- a link to the corresponding FrameNet URI.
- See Also:
-
getVerbNetURI
Deprecated.Get a link to the corresponding VerbNet URI (emptyStringif no interlinking is available or possible)- Returns:
- a link to the corresponding VerbNet URI.
- See Also:
-
getSenseString
Deprecated.Please usegetSensekey()Gets a String-based representation of thisBabelSensealternative to the "canonical" one obtained usingtoString(). 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.Moved toWordNetSenseGets the sense number of thisBabelSense. This corresponds to the sense number found in WordNet, if the sense belongs to WordNet, 0 otherwise.- Returns:
- the sense number of this
BabelSense.
-
getGlosses
Description copied from interface:SenseReturns theBabelGlosses associated to thisSense.- Specified by:
getGlossesin interfaceSense- Returns:
- the
BabelGlosses of thisSense
-
getLicense
-
getTags
-
getTags
-
isTaggedAs
Description copied from interface:TaggableChecks if all the given tags are contained in thisTaggable.- Specified by:
isTaggedAsin interfaceTaggable- Parameters:
tags- the tags of interest- Returns:
- true if all the given tags are contained in this
Taggable, false othwerwise
-
isTaggedAs
Description copied from interface:TaggableChecks if all the given tags are contained in thisTaggable.- Specified by:
isTaggedAsin interfaceTaggable- Parameters:
tags- the tags of interest- Returns:
- true if all the given tags are contained in this
Taggable, false othwerwise
-
isTaggedAs
Description copied from interface:TaggableChecks if the given tag are contained in thisTaggable.- Specified by:
isTaggedAsin interfaceTaggable- Parameters:
tag- the tag of interest- Returns:
- true if all the given tags are contained in this
Taggable, false othwerwise
-
toString
-
hashCode
-
equals
-
toURI(ExternalResource)