class documentation

class BabelSenseComparator:

Known subclasses: babelnet.sense.BabelWordSenseComparator

View In Hierarchy

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_wordnet_senses Sort wordnet senses
Method _sort_by_parentheses Sort two BabelSenses by parenthesis (senses without parenthesis first).
def compare(self, b1, b2):

Compare two BabelSense(s)

Parameters
b1:BabelSenseFirst BabelSense.
b2:BabelSenseSecond BabelSense.
Returns
intCompare result.
def sort_wordnet_senses(wn1, wn2):

Sort wordnet senses

Parameters
wn1:WordNetSensethe first sense
wn2:WordNetSensethe second sense
Returns
intthe result of the comparation.
def _sort_by_parentheses(self, b1, b2):

Sort two BabelSenses by parenthesis (senses without parenthesis first).

Parameters
b1:BabelSenseFirst BabelSense.
b2:BabelSenseSecond BabelSense.
Returns
intCompare result.