def get_assignment(resonances):
    """Get assignment from resonances."""
    parts = []
    last_group = None
    for resonance in resonances:
        if resonance['name']:
            part = []
            if resonance['group'] is not None and resonance['group'
                ] != last_group:
                part.append(resonance['group'])
            part.append(resonance['nucleus'])
            parts.append(''.join(part))
            last_group = resonance['group']
    return '-'.join(parts)
