naf2conll/naf2conll/util.py
def add_sentence_layer_to_words(words, sentence_items):
    """
    Splits a collection of words into a sequence of sentences using information
    from a sequence of sentence items.

    Returns a list of lists of words
    """
    words = {word['id']: word for word in words}
    return [
        [words.get(ID) for ID in sentence_item['span']]
        for sentence_item in sentence_items
    ]

    Splits a collection of words into a sequence of sentences using information
    from a sequence of sentence items.

    Returns a list of lists of words
    
Splits a collection of words into a sequence of sentences using information
from a sequence of sentence items.

Returns a list of lists of words
Splits a collection of words into a sequence of sentences using information from a sequence of sentence items . Returns a list of lists of words
def add_sentence_layer_to_words(words, sentence_items):
    words = {word['id']: word for word in words}
    return [
        [words.get(ID) for ID in sentence_item['span']]
        for sentence_item in sentence_items
    ]
def add_sentence_layer_to_words ( words , sentence_items ) : words = { word [ 'id' ] : word for word in words } return [ [ words . get ( ID ) for ID in sentence_item [ 'span' ] ] for sentence_item in sentence_items ]
Splits a collection of words into a sequence of sentences using information
from a sequence of sentence items.
Splits a collection of words into a sequence of sentences using information from a sequence of sentence items .
"""
    Splits a collection of words into a sequence of sentences using information
    from a sequence of sentence items.

    Returns a list of lists of words
    """
words
sentence_items