def get_conjunctions(tokens):    
    """Identify, color and count conjunctions that connect to main clauses"""

    # identify conjunctions
    conj = [t for t in tokens if t.lemma in ['und','aber','sondern','denn','oder','doch', 'sowie'] and \
            t.full_pos == 'KON' and t.function == 'kon' and
          len([k for k in tokens if (k.dependency == t.position) and (k.full_pos.endswith('FIN') or \
                                                                      k.full_pos.endswith('PP')) and k.function == 'cj'])> 0 and
          len([k for k in tokens if (k.position == t.dependency) and (k.full_pos.endswith('FIN') or \
                                                                      k.full_pos.endswith('PP'))])> 0]
         
    # color conjunctions
    for t in conj:
        t.clause_color.append('Conjunctions')
        t.pattern_color.append('Conjunctions')
        
    return len(conj)