def _split_paragraphs(text):
    """
    Splits a piece of text into paragraphs, separated by empty lines.

    """
    lines = text.splitlines()
    paragraphs = [[]]
    for line in lines:
        if len(line.strip()) > 0:
            paragraphs[-1] += [line]
        elif len(paragraphs[-1]) > 0:
            paragraphs.append([])
    paragraphs = map(' '.join, paragraphs)
    paragraphs = map(str.strip, paragraphs)
    paragraphs = filter(lambda s : s != '', paragraphs)
    return paragraphs