def split_text(text: str, split_by: str = 'sentence', split_length: int = 2, split_overlap: int = 1, 
               language: str = 'english', custom_seperator: str = None) -> List[str]:
    """ splits a single piece of text into smaller sub-texts based on splitting method (split_by).
        for example, the text can can be split at the character, word, sentence or passage level.
        optionally it can be split with a custom splitting string

    Args:
        text (str): _description_
        split_by (str, optional): _description_. Defaults to 'character'.
        split_length (int, optional): _description_. Defaults to 128.
        split_overlap (int, optional): _description_. Defaults to 16.
        language (str, optional): _description_. Defaults to 'english'.
        seperator (str, optional): _description_. Defaults to " ".

    Raises:
        TypeError: _description_

    Returns:
        List[str]: _description_
    """

    if split_length == 0:
        raise ValueError("split length must be > 0")

    # simple validation and correction    
    text = check_make_string_valid(text, coerce=True)

    # don't split if it is not worth splitting
    if len(text) <= 1:
        return [text]

    # we need to treat character splitting differently
    if custom_seperator is None:
        seperator = '' if split_by == 'character' else ' '
    else: 
        seperator = custom_seperator

    # determine how we want to split
    _func = _splitting_functions(split_by, language=language)

    # do the splitting
    split_text = _func(text)
    
    # concatenate individual elements based on split_length & split_stride
    segments = list(windowed(split_text, n=split_length, step=split_length - split_overlap))

    # reconstruct the segments. there is potential for a lossy process here as we
    # assume a uniform seperator when reconstructing the sentences
    text_splits = _reconstruct_multi_list(segments, seperator)


    return text_splits
 splits a single piece of text into smaller sub-texts based on splitting method (split_by).
        for example, the text can can be split at the character, word, sentence or passage level.
        optionally it can be split with a custom splitting string

    Args:
        text (str): _description_
        split_by (str, optional): _description_. Defaults to 'character'.
        split_length (int, optional): _description_. Defaults to 128.
        split_overlap (int, optional): _description_. Defaults to 16.
        language (str, optional): _description_. Defaults to 'english'.
        seperator (str, optional): _description_. Defaults to " ".

    Raises:
        TypeError: _description_

    Returns:
        List[str]: _description_
    
src/marqo/s2_inference/processing/text.py