Beispiel #1
0
 def add_concept(self, concept, label):
     """ adds a concept to the CP and the label to the lexicon 
         it is not be used for the prototype however, and hence the data 
         will not be stored in the cp.prototype_data
     """                      
     concept_new = copy.deepcopy(concept)    # make a copy     
     tag = aux.generateRandomTag(4)
     self.lex.add_label(label, tag)
     self.cp.add_concept(concept, tag)
Beispiel #2
0
 def add_exemplar(self, exemplar, label):
     """ adds exemplar data to the CP and the label to the lexicon """
     exemplar_new = copy.deepcopy(exemplar)    # make a copy
     # label is known
     if label in self.lex.get_labels():   
         tag = self.lex.get_tag(label)
     # label is not known
     else:                           
         tag = aux.generateRandomTag(4)
         self.lex.add_label(label, tag)
     self.cp.add_exemplar(exemplar_new, tag)