Beispiel #1
0
 def add_const(self, slot, value, negate=False):
     """
     """
     if not negate:
         op = '='
     else:
         op = '!='
     item = dact.DactItem(slot, op, value)
     self.constraints.append(item)
 def contains(self, slot, value, negate=False):
     '''
     :param slot: (str)
     :param value: (str)
     :param negate: (bool - default False)
     :returns: (bool) is full semantic act in self.items?
     '''
     op = '='
     if negate:
         op = '!='
     item = dact.DactItem(slot, op, value)
     return item in self.items
    def append_front(self, slot, value, negate=False):
        '''
        Add item to this act avoiding duplication

        :param slot: (str)
        :param value: (str) 
        :param negate: (bool) operation is '=' or not?  False by default.
        :return:
        '''
        op = '='
        if negate:
            op = '!='
        self.items = [dact.DactItem(slot, op, value)] + self.items
    def append(self, slot, value, negate=False):
        '''
        Add item to this act avoiding duplication

        :param slot: (str) 
        :param value: (str)
        :param negate: (bool [Default=False]) semantic operation is negation or not
        :return:
        '''
        op = '='
        if negate:
            op = '!='
        self.items.append(dact.DactItem(slot, op, value))