コード例 #1
0
ファイル: api.py プロジェクト: Asgardian8740/Django
 def __lt__(self, other):
     if not isinstance(other, AbstractCCGCategory):
         raise_unorderable_types("<", self, other)
     if self.__class__ is other.__class__:
         return self._comparison_key < other._comparison_key
     else:
         return self.__class__.__name__ < other.__class__.__name__
コード例 #2
0
ファイル: api.py プロジェクト: rfbonett/tribehacks
 def __lt__(self, other):
     if not isinstance(other, AbstractCCGCategory):
         raise_unorderable_types("<", self, other)
     if self.__class__ is other.__class__:
         return self._comparison_key < other._comparison_key
     else:
         return self.__class__.__name__ < other.__class__.__name__
コード例 #3
0
 def __lt__(self, other):
     if not isinstance(other, Tree):
         raise_unorderable_types("<", self, other)
     if self.__class__ is other.__class__:
         return (self._label, list(self), self.prob()) < (
             other._label,
             list(other),
             other.prob(),
         )
     else:
         return self.__class__.__name__ < other.__class__.__name__
コード例 #4
0
 def __lt__(self, other):
     if not isinstance(other, DependencySpan):
         raise_unorderable_types("<", self, other)
     return self._comparison_key < other._comparison_key
コード例 #5
0
 def __lt__(self, other):
     if not isinstance(other, DependencySpan):
         raise_unorderable_types("<", self, other)
     return self._comparison_key < other._comparison_key
コード例 #6
0
 def __lt__(self, other):
     if type(other) != type(self):
         raise_unorderable_types("<", self, other)
     return list(self) < list(other)
コード例 #7
0
ファイル: util.py プロジェクト: jasondigitized/quotationr
 def __lt__(self, other):
     if type(other) != type(self):
         raise_unorderable_types("<", self, other)
     return list(self) < list(other)
コード例 #8
0
 def __lt__(self, other):
     if not isinstance(other, FeatureValueType):
         raise_unorderable_types("<", self, other)
     return self._value < other._value
コード例 #9
0
 def __lt__(self, other):
     if not isinstance(other, Production):
         raise_unorderable_types("<", self, other)
     return (self._lhs, self._rhs) < (other._lhs, other._rhs)
コード例 #10
0
 def __lt__(self, other):
     if not isinstance(other, Nonterminal):
         raise_unorderable_types("<", self, other)
     return self._symbol < other._symbol
コード例 #11
0
 def __le__(self, other):
     if not isinstance(other, FreqDist):
         raise_unorderable_types("<=", self, other)
     return set(self).issubset(other) and all(self[key] <= other[key] for key in self)