def get_text_documents(mmif_obj):
    """Returns a dictionary of all text documents, indexed on the identifier."""
    docs = {}
    for view in mmif_obj['views']:
        for annotation in view['annotations']:
            if 'TextDocument' in annotation['@type']:
                full_id = "%s:%s" % (view['id'], annotation['properties']['id'])
                docs[full_id] = annotation
    return docs