def sliding_window(x, window_size=10, step_size=1):
    """
    Generate substrings by the sliding window algorithm

    Parameters
    -----
    x : str
        input string
    window_size : int
        window size (default: 10)
    step_size : int
        step size (default: 1)
    """
    n_chunks = (len(x) - window_size) / step_size + 1
    for i in range(0, int(n_chunks * step_size), step_size):
        yield x[i:i + window_size]
