Ejemplo n.º 1
0
 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__
Ejemplo n.º 2
0
 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__
Ejemplo n.º 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__
Ejemplo n.º 4
0
 def __lt__(self, other):
     if not isinstance(other, DependencySpan):
         raise_unorderable_types("<", self, other)
     return self._comparison_key < other._comparison_key
Ejemplo n.º 5
0
 def __lt__(self, other):
     if not isinstance(other, DependencySpan):
         raise_unorderable_types("<", self, other)
     return self._comparison_key < other._comparison_key
Ejemplo n.º 6
0
 def __lt__(self, other):
     if type(other) != type(self):
         raise_unorderable_types("<", self, other)
     return list(self) < list(other)
Ejemplo n.º 7
0
 def __lt__(self, other):
     if type(other) != type(self):
         raise_unorderable_types("<", self, other)
     return list(self) < list(other)
Ejemplo n.º 8
0
 def __lt__(self, other):
     if not isinstance(other, FeatureValueType):
         raise_unorderable_types("<", self, other)
     return self._value < other._value
Ejemplo n.º 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)
Ejemplo n.º 10
0
 def __lt__(self, other):
     if not isinstance(other, Nonterminal):
         raise_unorderable_types("<", self, other)
     return self._symbol < other._symbol
Ejemplo n.º 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)