class documentation
class _InternalBabelSynsetComparator:
Known subclasses: babelnet.synset.BabelSynsetComparator
Comparator for BabelSynsets that
- puts WordNet synsets first;
- sorts WordNet synsets based on the sense number of a specific input word (see the constructor);
- sorts Wikipedia synsets based on their degree and lexicographically based on their main sense
| Method | __init__ |
init method |
| Method | compare |
Compare two BabelSynset(s) |
| Class Method | _valid |
Get a valid degree from the given BabelSynset |
| Static Method | _compare |
Compare two BabelSynset based on the edges and then on the man sense. |
| Instance Variable | _language |
the language to use for the comparation |
| Instance Variable | _word |
the word to use for the comparation |
def compare(self, b1, b2):
overridden in
babelnet.synset.BabelSynsetComparatorCompare two BabelSynset(s)
| Parameters | |
b1:BabelSynset | First BabelSynset. |
b2:BabelSynset | Second BabelSynset. |
| Returns | |
int | Compare result. |
Get a valid degree from the given BabelSynset
| Parameters | |
bs:BabelSynset | the BabelSynset. |
| Returns | |
int | a valid degree for the given synset |
Compare two BabelSynset based on the edges and then on the man sense.
| Parameters | |
b1:BabelSynset | First BabelSynset. |
b2:BabelSynset | Second BabelSynset. |
| Returns | |
int | the result of the comparation. |