def _create_events_interface(self):
     transition_events_interface = []
     flat_final_content = list(chain(*self._exchange_states()))
     sub_sent = [chunk for chunk in flat_final_content if chunk[0] == 'transition']
     events_interface = modified_groupby(sub_sent, key=lambda chunk: chunk[0])
     for k, transition_chunks in events_interface.items():
         for chunk in transition_chunks:
             transition_events_interface.append(chunk[1:])
     formated_transition_events_interface = map(lambda event: '\nin event ' + \
                                                ''.join(event), transition_events_interface)
     return '\n\ninterface:' + ''.join(formated_transition_events_interface)
 def _create_objects_interface(self):
     formated_objects_interface = []
     specification = []
     for sent in self._exchange_states():
          for chunk in sent:
              if chunk[0] == 'specification':
                  specification.append(trigrams([chunk[1], chunk[-2], \
                                     self._convert_to_yakindu_type(type(chunk[-1]).__name__)]))
     default_specification = list(OrderedSet(chain(*specification)))
     objects_specification = modified_groupby(default_specification, key=lambda obj: obj[0])
     for obj, specification_chunks in objects_specification.items():
         formated_objects_interface.append('\n\ninterface ' + obj + ':')
         for chunk in specification_chunks:
              formated_objects_interface.append('\nvar ' + chunk[-2] + ':' + chunk[-1])               
     return ''.join(formated_objects_interface)