class documentation

class BabelSynsetRelationComparator:

View In Hierarchy

Comparator for BabelSynsets.

It does the following:

  • sorts Babel synsets using theirs relations number
  • sorts using BabelSynsetComparator
Method __init__ init method
Method compare Compare two BabelSynsets
Static Method _compare_by_relation_then_main_sense A comparator function that first compares two synset using the gloss and then using the main sense
Instance Variable _language The language used to sort senses (default Language.EN).
Instance Variable _word The word whose sense numbers are used to sort the BabelSynsets corresponding to WordNet synsets.
def __init__(self, word, language=Language.EN):

init method

Parameters
word:strThe word whose sense numbers are used to sort the BabelSynsets corresponding to WordNet synsets.
language:LanguageThe language used to sort senses (default English).
def compare(self, b1, b2):

Compare two BabelSynsets

Parameters
b1:BabelSynsetFirst BabelSynset.
b2:BabelSynsetSecond BabelSynset.
Returns
intCompare result.
@staticmethod
def _compare_by_relation_then_main_sense(b1, b2):

A comparator function that first compares two synset using the gloss and then using the main sense

Parameters
b1:BabelSynsetFirst BabelSynset.
b2:BabelSynsetSecond BabelSynset.
Returns
intCompare result.
_language =

The language used to sort senses (default Language.EN).

_word =

The word whose sense numbers are used to sort the BabelSynsets corresponding to WordNet synsets.