morphkit.split_into_raw_blocks

morphkit.split_into_raw_blocks(text: str, debug: bool = False) List[List[str]][source]

Split the input text into blocks at each ‘:raw’ header using multiline regex.

Args:

text (str):

The input text to be split.

debug (bool):

Optional argument. Defaults to False. If set to True the function print some debug information.

Returns:

List[List[str]]:

A list of raw blocks, where each block is a list of lines.

Example:

raw_text=morphkit.get_word_blocks("tou",api_endpoint)
blocks=morphkit.split_into_raw_blocks(raw_text)
for block in blocks:
    # Process each individual block