Extracts the position of a paragraph from the identifier, and the parent directory of the
    paragraph.

    Parameters
    ----------
    directory : Path
        A parent directory of a paragraph.
    identifier : str
        An identifier of a paragraph.

    Returns
    -------
    float
        The estimated position of the paragraph in the range [0; 1).

def get_position(directory, identifier):
    """
    Extracts the position of a paragraph from the identifier, and the parent directory of the
    paragraph.

    Parameters
    ----------
    directory : Path
        A parent directory of a paragraph.
    identifier : str
        An identifier of a paragraph.

    Returns
    -------
    float
        The estimated position of the paragraph in the range [0; 1).
    """
    paragraph_number = get_paragraph_number(identifier)
    paragraph_total = max(  # Not all paragraphs are stored, e.g. because of processing errors.
        get_paragraph_number(get_identifier(document)) + 1
        for document in directory.iterdir())
    assert paragraph_total > paragraph_number and paragraph_total > 0
    position = paragraph_number / paragraph_total
    return position