Package it.uniroma1.lcl.babelnet
Class BabelSense
- java.lang.Object
-
- it.uniroma1.lcl.babelnet.BabelSense
-
- Direct Known Subclasses:
WordNetSense
public class BabelSense extends Object implements Sense
A sense inBabelNet, contained in aBabelSynset.- Author:
- navigli, ponzetto
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBabelSense.BuilderThe Builder of aBabelSense.
-
Field Summary
Fields Modifier and Type Field Description protected StringfullLemmaThe full lemma for this senseprotected it.uniroma1.lcl.jlt.util.LanguagelanguageThe language of this senseprotected BabelLemmalemmaThe BabelLemma for this senseprotected it.uniroma1.lcl.jlt.util.POSposThe part-of-speech of this senseprotected StringsenseKeyThe sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if anyprotected StringsimpleLemmaThe simple lemma for this sense (without parentheses, etc.)protected BabelSenseSourcesourceThe source of this lemma: WordNet, Wikipedia, translation, etc.protected BabelSynsetsynsetThe synset this sense belongs toprotected BabelSynsetIDsynsetIDThe synset id this sense belongs to
-
Constructor Summary
Constructors Modifier Constructor Description protectedBabelSense(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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)StringgetDBPediaURI()Deprecated.StringgetFrameNetURI()Deprecated.IntegergetFrequency()Deprecated.DiscontinuedStringgetFullLemma()Gets the full lemma of thisSense(which might include annotations, such as labels in Wikipedia page titles).StringgetGeoNamesURI()Deprecated.Collection<BabelGloss>getGlosses()Returns theBabelGlosses associated to thisSense.intgetID()Gets the numeric id of the sense.it.uniroma1.lcl.jlt.util.LanguagegetLanguage()Gets theLanguageof thisSenseBabelLemmagetLemma()Gets the lemma of thisSense.BabelLicensegetLicense()Returns the license for this Babel senseStringgetNormalizedLemma()Gets the normalized lemma of thisSense.it.uniroma1.lcl.jlt.util.POSgetPOS()Gets the part of speech of thisSense.IntegergetPosition()Deprecated.Moved toWordNetSenseBabelSensePhoneticsgetPronunciations()Returns the pronunciationsStringgetSensekey()Gets the sensekey of the WordNet, Omega, Wikidata or Wiktionary sense to which thisBabelSensecorresponds, if any.intgetSenseNumber()Deprecated.Moved toWordNetSenseStringgetSenseString()Deprecated.Please usegetSensekey()BabelSenseTranslationInfogetSenseTranslationInfo()Deprecated.To be removed in the next API releaseStringgetSimpleLemma()Deprecated.BabelSenseSourcegetSource()Gets theBabelSenseSourceof thisSense.BabelSynsetgetSynset()Gets theBabelSynsetthisSensebelongs to.BabelSynsetIDgetSynsetID()Returns the id of theSynsetthe sense belongs toCollection<Tag>getTags()<T extends Tag>
Collection<T>getTags(Class<T> classTag)Returns the collection of the given class of thisTaggable.StringgetVerbNetURI()Deprecated.Optional<String>getWordNetOffset()Deprecated.Moved toWordNetSenseStringgetYAGOURI()Deprecated.inthashCode()booleanisAutomaticTranslation()Returns true if the sense is the result of an automatic translationbooleanisKeyConcept()Deprecated.Use {@link BabelSense:isKeySense()} insteadbooleanisKeySense()Returns true if it is a key sensebooleanisNotAutomaticTranslation()Returns 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.StringtoString()Optional<String>toURI(ExternalResource resource)Returns the URI of the sense for a givenExternalResource
-
-
-
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 aBabelSense- Parameters:
language- the language of the senselemma- the lemma of the sensesimpleLemma- the simple lemma 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 Detail
-
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 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:SenseReturns true if it is a key sense- Specified by:
isKeySensein interfaceSense- Returns:
- true if it is a key sense, false otherwise
-
getFullLemma
public String 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 public String 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
public String 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
public BabelLemma getLemma()
Description copied from interface:SenseGets the lemma of thisSense.
-
getPOS
public it.uniroma1.lcl.jlt.util.POS getPOS()
Description copied from interface:SenseGets the part of speech of thisSense.
-
getSource
public BabelSenseSource 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
public BabelSynset getSynset()
Description copied from interface:SenseGets theBabelSynsetthisSensebelongs to.- Specified by:
getSynsetin interfaceSense- Returns:
- the
BabelSynsetof thisSense.
-
getSensekey
public String 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 public Optional<String> 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 public Integer 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 public Integer 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 public BabelSenseTranslationInfo getSenseTranslationInfo()
Deprecated.To be removed in the next API releaseGets translation-related information about thisBabelSense.- Returns:
- translation-related information about this
BabelSense.
-
getPronunciations
public BabelSensePhonetics getPronunciations()
Returns the pronunciations- Returns:
- BabelSensePronunciations
BabelSense
-
getSynsetID
public BabelSynsetID 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
public Optional<String> toURI(ExternalResource resource)
Description copied from interface:SenseReturns the URI of the sense for a givenExternalResource
-
getDBPediaURI
@Deprecated public String 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:
- DBPedia interlinking
-
getYAGOURI
@Deprecated public String 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:
- YAGO
-
getGeoNamesURI
@Deprecated public String 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:
- GeoNames
-
getFrameNetURI
@Deprecated public String 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:
- FrameNet
-
getVerbNetURI
@Deprecated public String 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:
- VerbNet
-
getSenseString
@Deprecated public String 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 public int 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
public Collection<BabelGloss> getGlosses()
Description copied from interface:SenseReturns theBabelGlosses associated to thisSense.- Specified by:
getGlossesin interfaceSense- Returns:
- the
BabelGlosses of thisSense
-
getLicense
public BabelLicense getLicense()
Returns the license for this Babel sense- Returns:
- the license
-
getTags
public Collection<Tag> getTags()
Description copied from interface:Taggable
-
getTags
public <T extends Tag> Collection<T> getTags(Class<T> classTag)
Description copied from interface:TaggableReturns the collection of the given class of thisTaggable.
-
isTaggedAs
public boolean isTaggedAs(Tag... tags)
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
public boolean isTaggedAs(Collection<Tag> tags)
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
public boolean isTaggedAs(Tag tag)
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
-
-