coder160's picture
first_commit: docker instance, main methods
1280b99
raw
history blame
450 Bytes
class Generator:
def get_bloques(from_text:str, size:int=1500):
_bloques = list()
_t = str(from_text)
if len(_t)>size:
_ = int(len(_t)/2)
_ts = [_t[n:n+_] for n in range(0,len(_t),_)]
for m in [0,1]:
_np = [nt for nt in Generator.get_bloques(from_text=_ts[m],size=size)]
_bloques+=_np
else:
_bloques.append(_t)
return _bloques