def add_raw_from_text_layer(naf_obj):
    """
    Goes through NAF's token layer and adds a raw layer based on its data.
    :param naf_obj: nafobject containing text layer
    :return: None
    """
    raw = ''
    offset = 0
    paragraph = '1'
    for tok in naf_obj.get_tokens():
        if tok.get_offset() != str(offset):
            raw += ' '
            offset += 1
        if tok.get_para() != paragraph:
            raw += '\n\n'
            paragraph = tok.get_para()
        token = tok.get_text()
        raw += token
        offset += len(token)
    naf_obj.set_raw(raw)
