Esempio n. 1
0
 def __eq__(self, other):
     """
     @return: true if this C{CFGProduction} is equal to C{other}.
     @rtype: C{boolean}
     """
     return (_classeq(self, other) and self._lhs == other._lhs
             and self._rhs == other._rhs)
Esempio n. 2
0
 def __eq__(self, other):
     """
     @return: true if this C{CFGProduction} is equal to C{other}.
     @rtype: C{boolean}
     """
     return (_classeq(self, other) and
             self._lhs == other._lhs and
             self._rhs == other._rhs)
 def __cmp__(self, other):
     """
     @return: 0 if this C{LabeledType} is equal to C{other}.  In
         particular, return 0 iff C{other} is a C{LabeledType},
         C{self.text()==other.text()}, and
         C{self.label()==other.label()}; return a nonzero number
         otherwise. 
     @rtype: C{int}
     @param other: The C{LabeledText} to compare this
         C{LabeledText} with.
     @type other: C{LabeledText}
     """
     if not _classeq(self, other): return 0
     return not (self._text == other._text and self._label == other._label)
Esempio n. 4
0
 def __cmp__(self, other):
     """
     @return: 0 if this C{LabeledType} is equal to C{other}.  In
         particular, return 0 iff C{other} is a C{LabeledType},
         C{self.text()==other.text()}, and
         C{self.label()==other.label()}; return a nonzero number
         otherwise. 
     @rtype: C{int}
     @param other: The C{LabeledText} to compare this
         C{LabeledText} with.
     @type other: C{LabeledText}
     """
     if not _classeq(self, other):
         return 0
     return not (self._text == other._text and self._label == other._label)
Esempio n. 5
0
 def __eq__(self, other):
     return (_classeq(self, other) and self._lhs == other._lhs
             and self._rhs == other._rhs and self.prob() == other.prob())
Esempio n. 6
0
 def __cmp__(self, other):
     if not _classeq(self, other): return -1
     return cmp((self._lhs, self._rhs), (other._lhs, other._rhs))
Esempio n. 7
0
 def __eq__(self, other):
     return (_classeq(self, other) and
             self._lhs == other._lhs and
             self._rhs == other._rhs and
             self.prob() == other.prob())
Esempio n. 8
0
 def __cmp__(self, other):
     if not _classeq(self, other): return -1
     return cmp((self._lhs, self._rhs), (other._lhs, other._rhs))