class documentation
class BabelSenseComparator:
Known subclasses: babelnet.sense.BabelWordSenseComparator
Comparator for BabelSenses that:
- puts WordNet senses first
- sorts WordNet senses based on their sense number
- sorts Wikipedia senses lexicographically
Method | compare |
Compare two BabelSense(s) |
Method | sort |
Sort wordnet senses |
Method | _sort |
Sort two BabelSenses by parenthesis (senses without parenthesis first). |
def compare(self, b1, b2):
Compare two BabelSense(s)
Parameters | |
b1:BabelSense | First BabelSense. |
b2:BabelSense | Second BabelSense. |
Returns | |
int | Compare result. |
def sort_wordnet_senses(wn1, wn2):
Sort wordnet senses
Parameters | |
wn1:WordNetSense | the first sense |
wn2:WordNetSense | the second sense |
Returns | |
int | the result of the comparation. |
def _sort_by_parentheses(self, b1, b2):
overridden in
babelnet.sense.BabelWordSenseComparator
Sort two BabelSenses by parenthesis (senses without parenthesis first).
Parameters | |
b1:BabelSense | First BabelSense. |
b2:BabelSense | Second BabelSense. |
Returns | |
int | Compare result. |