bricks icon indicating copy to clipboard operation
bricks copied to clipboard

[MODULE] - Newline chunking/ splitting

Open LeonardPuettmannKern opened this issue 2 years ago • 0 comments

Please describe the module you would like to add to bricks A simple brick that splits a texts by newline characters.

Do you already have an implementation?

ATTRIBUTE: str = "text" # only text attributes

def newline_splitter(text: str) -> List[str]:
    splits = text.strip().split("\n")
    return [val for val in splits if len(val) > 0]

LeonardPuettmannKern avatar Oct 06 '23 16:10 LeonardPuettmannKern