Package it.uniroma1.lcl.babelnet
Class BabelSenseComparator
- java.lang.Object
-
- it.uniroma1.lcl.babelnet.BabelSenseComparator
-
- All Implemented Interfaces:
Comparator<BabelSense>
- Direct Known Subclasses:
BabelWordSenseComparator
public class BabelSenseComparator extends Object implements Comparator<BabelSense>
Comparator
forBabelSense
s that (a) puts WordNet senses first; (b) sorts WordNet senses based on their sense number; (c) sorts Wikipedia senses based on their degree and lexicographically- Author:
- navigli, vannella
-
-
Constructor Summary
Constructors Constructor Description BabelSenseComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(BabelSense b1, BabelSense b2)
protected int
sortByParentheses(BabelSense b1, BabelSense b2)
Sorts two s by parenthesis (senses without parenthesis first)-
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
-
-
-
-
Method Detail
-
sortByParentheses
protected int sortByParentheses(BabelSense b1, BabelSense b2)
Sorts two s by parenthesis (senses without parenthesis first)- Parameters:
b1
- the first senseb2
- the second sense- Returns:
- the order (standard format for
Comparator
s)
-
compare
public int compare(BabelSense b1, BabelSense b2)
- Specified by:
compare
in interfaceComparator<BabelSense>
-
-