Compare commits
1 Commits
7ea8452e61
...
0655d4ceec
Author | SHA1 | Date |
---|---|---|
Daniel Sun | 0655d4ceec |
|
@ -61,17 +61,23 @@ def search_group(query, count):
|
|||
def __init__(self, string, score):
|
||||
self.string = string
|
||||
self.score = score
|
||||
|
||||
# consider a score worse if the edit distance is larger
|
||||
def __lt__(self, other):
|
||||
return self.score > other.score
|
||||
|
||||
def __gt__(self, other):
|
||||
return self.score < other.score
|
||||
|
||||
def __le__(self, other):
|
||||
return self.score >= other.score
|
||||
|
||||
def __ge__(self, other):
|
||||
return self.score <= other.score
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.score == other.score
|
||||
|
||||
def __ne__(self, other):
|
||||
return self.score != other.score
|
||||
|
||||
|
|
Loading…
Reference in New Issue