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 int
ID_LENGTH
ID string lengthstatic String
ID_PREFIX
The WordNet offset prefixstatic int
OEWN_ID_LENGTH
Open English WordNet ID string lengthstatic String
OEWN_ID_PREFIX
The Open English WordNet offset prefixstatic int
WN2020_ID_LENGTH
WordNet 2020 ID string lengthstatic String
WN2020_ID_PREFIX
The 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_30
WordNetSynsetID(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.WordNetVersion
getVersion()
Return the version of thisWordNetSynsetID
protected boolean
isValid()
Returns true if the synset ID is validprotected void
setMappingOffsets(HashMap<it.uniroma1.lcl.jlt.wordnet.WordNetVersion,List<String>> versionMapping)
List<WordNetSynsetID>
toVersion(it.uniroma1.lcl.jlt.wordnet.WordNetVersion targetVersion)
Obtains a list ofWordNetSynsetID
s corresponding to thisWordNetSynsetID
in 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:SynsetID
Returns true if the synset ID is valid
-
toVersion
public List<WordNetSynsetID> toVersion(it.uniroma1.lcl.jlt.wordnet.WordNetVersion targetVersion)
Obtains a list ofWordNetSynsetID
s corresponding to thisWordNetSynsetID
in the inputWordNetVersion
- Parameters:
targetVersion
- the target version to convert to- Returns:
- a list of
WordNetSynsetID
s
-
getVersion
public it.uniroma1.lcl.jlt.wordnet.WordNetVersion getVersion()
Return the version of thisWordNetSynsetID
- Returns:
WordNetVersion
-
-