|
|
@@ -54,6 +54,16 @@ class Caption(object):
|
|
|
return -1
|
|
|
else:
|
|
|
return 1
|
|
|
+
|
|
|
+ # for version 3 compatibility (__cmp__ is deprecated)
|
|
|
+ def __lt__(self, other):
|
|
|
+ assert isinstance(other, Caption)
|
|
|
+ return self.score < other.score
|
|
|
+
|
|
|
+ # also for version 3 compatibility
|
|
|
+ def __eq__(self, other):
|
|
|
+ assert isinstance(other, Caption)
|
|
|
+ return self.score == other.score
|
|
|
|
|
|
|
|
|
class TopN(object):
|