class documentation
class BabelSynsetComparator(_InternalBabelSynsetComparator):
Comparator for BabelSynsets that:
- puts WordNet synsets first
- sorts WordNet synsets based on the sense number of a specific input word
- sorting Wikipedia synsets lexicographically based on their main sense
| Method | __init__ |
init method |
| Method | compare |
Compare two BabelSynset(s) |
| Method | __synset |
Calculate the score of a BabelSynset |
Inherited from _InternalBabelSynsetComparator:
| 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):
Compare two BabelSynset(s)
| Parameters | |
b1:BabelSynset | First BabelSynset. |
b2:BabelSynset | Second BabelSynset. |
| Returns | |
int | Compare result. |
def __synset_score(self, synset):
Calculate the score of a BabelSynset
| Parameters | |
synset:BabelSynset | the synset |
| Returns | |
int | the score |