Package it.uniroma1.lcl.babelnet
Class WordNetSynsetID
- java.lang.Object
-
- it.uniroma1.lcl.kb.ResourceID
-
- it.uniroma1.lcl.kb.SynsetID
-
- it.uniroma1.lcl.babelnet.WordNetSynsetID
-
public class WordNetSynsetID extends SynsetID
Constructs a resource identifier with the specified WordNet synset id.Usage example:
ResourceID rID = new WordNetSynsetID("wn:00632820n");- Author:
- navigli, vannella
-
-
Field Summary
Fields Modifier and Type Field Description static intID_LENGTHID string lengthstatic StringID_PREFIXThe WordNet offset prefixstatic intOEWN_ID_LENGTHOpen English WordNet ID string lengthstatic StringOEWN_ID_PREFIXThe Open English WordNet offset prefixstatic intWN2020_ID_LENGTHWordNet 2020 ID string lengthstatic StringWN2020_ID_PREFIXThe WordNet 2020 offset prefix-
Fields inherited from class it.uniroma1.lcl.kb.ResourceID
id, language, pos, source
-
-
Constructor Summary
Constructors Constructor Description WordNetSynsetID(String id)Builds a WordNet synset ID with versionWordNetVersion.WN_30WordNetSynsetID(String id, it.uniroma1.lcl.jlt.wordnet.WordNetVersion version)Constructs the WordNet synset ID
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description it.uniroma1.lcl.jlt.wordnet.WordNetVersiongetVersion()Return the version of thisWordNetSynsetIDprotected booleanisValid()Returns true if the synset ID is validprotected voidsetMappingOffsets(HashMap<it.uniroma1.lcl.jlt.wordnet.WordNetVersion,List<String>> versionMapping)List<WordNetSynsetID>toVersion(it.uniroma1.lcl.jlt.wordnet.WordNetVersion targetVersion)Obtains a list ofWordNetSynsetIDs corresponding to thisWordNetSynsetIDin the inputWordNetVersion-
Methods inherited from class it.uniroma1.lcl.kb.SynsetID
getSimpleOffset
-
Methods inherited from class it.uniroma1.lcl.kb.ResourceID
equals, getID, getLanguage, getPOS, getSource, hashCode, toString, toSynsets, toSynsets
-
-
-
-
Field Detail
-
ID_PREFIX
public static final String ID_PREFIX
The WordNet offset prefix- See Also:
- Constant Field Values
-
WN2020_ID_PREFIX
public static final String WN2020_ID_PREFIX
The WordNet 2020 offset prefix- See Also:
- Constant Field Values
-
OEWN_ID_PREFIX
public static final String OEWN_ID_PREFIX
The Open English WordNet offset prefix- See Also:
- Constant Field Values
-
ID_LENGTH
public static final int ID_LENGTH
ID string length- See Also:
- Constant Field Values
-
WN2020_ID_LENGTH
public static final int WN2020_ID_LENGTH
WordNet 2020 ID string length- See Also:
- Constant Field Values
-
OEWN_ID_LENGTH
public static final int OEWN_ID_LENGTH
Open English WordNet ID string length- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WordNetSynsetID
public WordNetSynsetID(String id) throws InvalidSynsetIDException
Builds a WordNet synset ID with versionWordNetVersion.WN_30- Parameters:
id- the synset ID string- Throws:
InvalidSynsetIDException- thrown if the synset ID is invalid
-
WordNetSynsetID
public WordNetSynsetID(String id, it.uniroma1.lcl.jlt.wordnet.WordNetVersion version) throws InvalidSynsetIDException
Constructs the WordNet synset ID- Parameters:
id- the synset ID stringversion- the WordNet version- Throws:
InvalidSynsetIDException- thrown if the synset ID is invalid
-
-
Method Detail
-
isValid
protected boolean isValid()
Description copied from class:SynsetIDReturns true if the synset ID is valid
-
toVersion
public List<WordNetSynsetID> toVersion(it.uniroma1.lcl.jlt.wordnet.WordNetVersion targetVersion)
Obtains a list ofWordNetSynsetIDs corresponding to thisWordNetSynsetIDin the inputWordNetVersion- Parameters:
targetVersion- the target version to convert to- Returns:
- a list of
WordNetSynsetIDs
-
getVersion
public it.uniroma1.lcl.jlt.wordnet.WordNetVersion getVersion()
Return the version of thisWordNetSynsetID- Returns:
WordNetVersion
-
-