To segment a set of chunks from strings or streams