Package it.uniroma1.lcl.babelnet
Class InternalBabelSynsetComparator
- java.lang.Object
-
- it.uniroma1.lcl.babelnet.InternalBabelSynsetComparator
-
- All Implemented Interfaces:
Comparator<BabelSynset>
- Direct Known Subclasses:
BabelSynsetComparator
public class InternalBabelSynsetComparator extends Object implements Comparator<BabelSynset>
Comparator
forBabelSynset
s that (a) puts WordNet synsets first; (b) sorts WordNet synsets based on the sense number of a specific input word (see the constructor); (c) sorts Wikipedia synsets based on their degree and lexicographically based on their main sense- Author:
- navigli
-
-
Constructor Summary
Constructors Constructor Description InternalBabelSynsetComparator()
Creates a new instance of aInternalBabelSynsetComparator
with sorting on the out-degreeInternalBabelSynsetComparator(String word)
Creates a new instance of aInternalBabelSynsetComparator
with sorting on the English languageInternalBabelSynsetComparator(String word, it.uniroma1.lcl.jlt.util.Language language)
Creates a new instance of aInternalBabelSynsetComparator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(BabelSynset b1, BabelSynset b2)
protected int
compareByEdgeThenMainSense(BabelSynset b1, BabelSynset b2)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
lemma
protected final String lemma
The lemma used to sort synsets
-
language
protected final it.uniroma1.lcl.jlt.util.Language language
Language used to sort synsets
-
-
Constructor Detail
-
InternalBabelSynsetComparator
public InternalBabelSynsetComparator()
Creates a new instance of aInternalBabelSynsetComparator
with sorting on the out-degree
-
InternalBabelSynsetComparator
public InternalBabelSynsetComparator(String word)
Creates a new instance of aInternalBabelSynsetComparator
with sorting on the English language- Parameters:
word
- the word whose sense numbers are used to sort theBabelSynset
s corresponding to WordNet synsets
-
InternalBabelSynsetComparator
public InternalBabelSynsetComparator(String word, it.uniroma1.lcl.jlt.util.Language language)
Creates a new instance of aInternalBabelSynsetComparator
- Parameters:
word
- the word whose sense numbers are used to sort theBabelSynset
s corresponding to WordNet synsetslanguage
- the language used to sort senses
-
-
Method Detail
-
compareByEdgeThenMainSense
protected int compareByEdgeThenMainSense(BabelSynset b1, BabelSynset b2)
-
compare
public int compare(BabelSynset b1, BabelSynset b2)
- Specified by:
compare
in interfaceComparator<BabelSynset>
-
-