def sort_annotations_by_offset(annotations):
    """
    This function expects as input a list of dictionaries with this structure:

    {'ann_id': u'T34',
     'continuation': False,
     'entity_type': u'Registry',
     'positions': [{'end': 2465, 'start': 2448}],
     'surface': u'reg 38 Padavinus,'},

    And sorts them by offset. When the annotations spans more than one token 
    (i.e. there is more than one position in `positions`) the offset_start 
    of the first token is considered.
    """
    return sorted(annotations, key=lambda k: k['positions'][0]['start'])