def utterance_to_capsules(utterance):
    """
    Transform an Utterance into a list of capsules
    :param utterance:
    :return:
    """
    capsules = []

    for triple in utterance.triples:
        capsule = {"chat": utterance.chat.id,
                   "turn": utterance.turn,
                   "author": utterance.chat_speaker,
                   "utterance": utterance.transcript,
                   "utterance_type": triple['utterance_type'],
                   "position": "0-" + str(len(utterance.transcript)),
                   ###
                   "subject": triple['subject'],
                   "predicate": triple['predicate'],
                   "object": triple['object'],
                   "perspective": triple["perspective"],
                   ###
                   "context_id": None,
                   "date": utterance.datetime.isoformat(),
                   "place": "",
                   "place_id": None,
                   "country": "",
                   "region": "",
                   "city": "",
                   "objects": [],
                   "people": []
                   }

        capsules.append(capsule)

    return capsules