class documentation

class BabelWordSenseComparator(BabelSenseComparator):

View In Hierarchy

BabelSenseComparator for BabelSenses with precedence given to a certain word.

Method __init__ init method
Instance Variable word The word whose sense numbers are used to sort the BabelSense.
Method _sort_by_parentheses Sort two BabelSenses by parenthesis (senses without parenthesis first).

Inherited from BabelSenseComparator:

Method compare Compare two BabelSense(s)
Method _sort_wordnet Sort wordnet senses
def __init__(self, word=None):

init method

Parameters
word:Optional[str]The word whose sense numbers are used to sort the BabelSense (default None).
word: Optional[str] =

The word whose sense numbers are used to sort the BabelSense.

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.