Class BabelSenseComparator
java.lang.Object
it.uniroma1.lcl.babelnet.BabelSenseComparator
- All Implemented Interfaces:
Comparator<BabelSense>
- Direct Known Subclasses:
BabelWordSenseComparator
Comparator for BabelSenses 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 -
Method Summary
Modifier and TypeMethodDescriptionintcompare(BabelSense b1, BabelSense b2) protected intsortByParentheses(BabelSense b1, BabelSense b2) Sorts twoBabelSenses by parenthesis (senses without parenthesis first)Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
BabelSenseComparator
public BabelSenseComparator()
-
-
Method Details
-
sortByParentheses
Sorts twoBabelSenses by parenthesis (senses without parenthesis first)- Parameters:
b1- the first senseb2- the second sense- Returns:
- the order (standard format for
Comparators)
-
compare
- Specified by:
comparein interfaceComparator<BabelSense>
-